<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module pso</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>pso</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jgenson/Development/betelgeuse-ml/lib/ml/pso.py">/home/jgenson/Development/betelgeuse-ml/lib/ml/pso.py</a></font></td></tr></table>
    <p><tt>A&nbsp;general&nbsp;implementation&nbsp;of&nbsp;particle&nbsp;swarm&nbsp;optimization&nbsp;(PSO).<br>
&nbsp;<br>
PSO&nbsp;operates&nbsp;on&nbsp;a&nbsp;population&nbsp;of&nbsp;particles&nbsp;that&nbsp;fly&nbsp;through&nbsp;a&nbsp;solution&nbsp;space,&nbsp;in<br>
search&nbsp;of&nbsp;the&nbsp;optimal&nbsp;position.&nbsp;Each&nbsp;particle&nbsp;keeps&nbsp;track&nbsp;of&nbsp;its&nbsp;personal&nbsp;best<br>
position&nbsp;and&nbsp;velocity,&nbsp;which&nbsp;it&nbsp;uses&nbsp;along&nbsp;with&nbsp;the&nbsp;global&nbsp;best&nbsp;position&nbsp;to<br>
calculate&nbsp;a&nbsp;new&nbsp;position&nbsp;and&nbsp;velocity.&nbsp;For&nbsp;more&nbsp;details&nbsp;see:<br>
<a href="http://www.swarmintelligence.org/">http://www.swarmintelligence.org/</a><br>
&nbsp;<br>
Most&nbsp;functions&nbsp;in&nbsp;this&nbsp;module&nbsp;are&nbsp;higher-order&nbsp;functions&nbsp;that&nbsp;return&nbsp;another<br>
function.&nbsp;To&nbsp;create&nbsp;a&nbsp;PSO&nbsp;optimizer,&nbsp;you&nbsp;must&nbsp;minimally&nbsp;call&nbsp;create_optimizer<br>
with&nbsp;a&nbsp;fitness&nbsp;function&nbsp;that&nbsp;you&nbsp;must&nbsp;supply&nbsp;yourself.<br>
&nbsp;<br>
Copyright&nbsp;(C)&nbsp;2013&nbsp;Jerrad&nbsp;Michael&nbsp;Genson<br>
&nbsp;<br>
This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>
it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;BSD&nbsp;3-Clause&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>
the&nbsp;Open&nbsp;Source&nbsp;Initiative.<br>
&nbsp;<br>
This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>
but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>
MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>
BSD&nbsp;3-Clause&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>
&nbsp;<br>
You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;BSD&nbsp;3-Clause&nbsp;License<br>
along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see<br>
&lt;https://betelgeuse-ml.googlecode.com/hg/LICENSE&gt;</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="random.html">random</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="numpy.html#ndarray">numpy.ndarray</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="pso.html#Particle">Particle</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Particle">class <strong>Particle</strong></a>(<a href="numpy.html#ndarray">numpy.ndarray</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;Numpy&nbsp;Array&nbsp;wrapper&nbsp;with&nbsp;added&nbsp;attributes&nbsp;to&nbsp;be&nbsp;compatible&nbsp;with&nbsp;PSO.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="pso.html#Particle">Particle</a></dd>
<dd><a href="numpy.html#ndarray">numpy.ndarray</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Particle-__array_finalize__"><strong>__array_finalize__</strong></a>(self, obj)</dt></dl>

<hr>
Static methods defined here:<br>
<dl><dt><a name="Particle-__new__"><strong>__new__</strong></a>(subtype, shape, dtype<font color="#909090">=&lt;class 'float'&gt;</font>, buffer<font color="#909090">=None</font>, offset<font color="#909090">=0</font>, strides<font color="#909090">=None</font>, order<font color="#909090">=None</font>, info<font color="#909090">=None</font>)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="numpy.html#ndarray">numpy.ndarray</a>:<br>
<dl><dt><a name="Particle-__abs__"><strong>__abs__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__abs__">__abs__</a>()&nbsp;&lt;==&gt;&nbsp;abs(x)</tt></dd></dl>

<dl><dt><a name="Particle-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__add__">__add__</a>(y)&nbsp;&lt;==&gt;&nbsp;x+y</tt></dd></dl>

<dl><dt><a name="Particle-__and__"><strong>__and__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__and__">__and__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&amp;y</tt></dd></dl>

<dl><dt><a name="Particle-__array__"><strong>__array__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__array__">__array__</a>(|dtype)&nbsp;-&gt;&nbsp;reference&nbsp;if&nbsp;type&nbsp;unchanged,&nbsp;copy&nbsp;otherwise.<br>
&nbsp;<br>
Returns&nbsp;either&nbsp;a&nbsp;new&nbsp;reference&nbsp;to&nbsp;self&nbsp;if&nbsp;dtype&nbsp;is&nbsp;not&nbsp;given&nbsp;or&nbsp;a&nbsp;new&nbsp;array<br>
of&nbsp;provided&nbsp;data&nbsp;type&nbsp;if&nbsp;dtype&nbsp;is&nbsp;different&nbsp;from&nbsp;the&nbsp;current&nbsp;dtype&nbsp;of&nbsp;the<br>
array.</tt></dd></dl>

<dl><dt><a name="Particle-__array_prepare__"><strong>__array_prepare__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__array_prepare__">__array_prepare__</a>(obj)&nbsp;-&gt;&nbsp;Object&nbsp;of&nbsp;same&nbsp;type&nbsp;as&nbsp;<a href="numpy.html#ndarray">ndarray</a>&nbsp;object&nbsp;obj.</tt></dd></dl>

<dl><dt><a name="Particle-__array_wrap__"><strong>__array_wrap__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__array_wrap__">__array_wrap__</a>(obj)&nbsp;-&gt;&nbsp;Object&nbsp;of&nbsp;same&nbsp;type&nbsp;as&nbsp;<a href="numpy.html#ndarray">ndarray</a>&nbsp;object&nbsp;a.</tt></dd></dl>

<dl><dt><a name="Particle-__bool__"><strong>__bool__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__bool__">__bool__</a>()&nbsp;&lt;==&gt;&nbsp;x&nbsp;!=&nbsp;0</tt></dd></dl>

<dl><dt><a name="Particle-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__contains__">__contains__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&nbsp;in&nbsp;x</tt></dd></dl>

<dl><dt><a name="Particle-__copy__"><strong>__copy__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__copy__">__copy__</a>([order])<br>
&nbsp;<br>
Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'C'&nbsp;(False)&nbsp;then&nbsp;the&nbsp;result&nbsp;is&nbsp;contiguous&nbsp;(default).<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'Fortran'&nbsp;(True)&nbsp;then&nbsp;the&nbsp;result&nbsp;has&nbsp;fortran&nbsp;order.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'Any'&nbsp;(None)&nbsp;then&nbsp;the&nbsp;result&nbsp;has&nbsp;fortran&nbsp;order<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;if&nbsp;the&nbsp;array&nbsp;already&nbsp;is&nbsp;in&nbsp;fortran&nbsp;order.</tt></dd></dl>

<dl><dt><a name="Particle-__deepcopy__"><strong>__deepcopy__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__deepcopy__">__deepcopy__</a>()&nbsp;-&gt;&nbsp;Deep&nbsp;copy&nbsp;of&nbsp;array.<br>
&nbsp;<br>
Used&nbsp;if&nbsp;copy.deepcopy&nbsp;is&nbsp;called&nbsp;on&nbsp;an&nbsp;array.</tt></dd></dl>

<dl><dt><a name="Particle-__delitem__"><strong>__delitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__delitem__">__delitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;del&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="Particle-__divmod__"><strong>__divmod__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__divmod__">__divmod__</a>(y)&nbsp;&lt;==&gt;&nbsp;divmod(x,&nbsp;y)</tt></dd></dl>

<dl><dt><a name="Particle-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__eq__">__eq__</a>(y)&nbsp;&lt;==&gt;&nbsp;x==y</tt></dd></dl>

<dl><dt><a name="Particle-__float__"><strong>__float__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__float__">__float__</a>()&nbsp;&lt;==&gt;&nbsp;float(x)</tt></dd></dl>

<dl><dt><a name="Particle-__floordiv__"><strong>__floordiv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__floordiv__">__floordiv__</a>(y)&nbsp;&lt;==&gt;&nbsp;x//y</tt></dd></dl>

<dl><dt><a name="Particle-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ge__">__ge__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;=y</tt></dd></dl>

<dl><dt><a name="Particle-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="Particle-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__gt__">__gt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;y</tt></dd></dl>

<dl><dt><a name="Particle-__iadd__"><strong>__iadd__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__iadd__">__iadd__</a>(y)&nbsp;&lt;==&gt;&nbsp;x+=y</tt></dd></dl>

<dl><dt><a name="Particle-__iand__"><strong>__iand__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__iand__">__iand__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&amp;=y</tt></dd></dl>

<dl><dt><a name="Particle-__ifloordiv__"><strong>__ifloordiv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ifloordiv__">__ifloordiv__</a>(y)&nbsp;&lt;==&gt;&nbsp;x//y</tt></dd></dl>

<dl><dt><a name="Particle-__ilshift__"><strong>__ilshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ilshift__">__ilshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;&lt;=y</tt></dd></dl>

<dl><dt><a name="Particle-__imod__"><strong>__imod__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__imod__">__imod__</a>(y)&nbsp;&lt;==&gt;&nbsp;x%=y</tt></dd></dl>

<dl><dt><a name="Particle-__imul__"><strong>__imul__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__imul__">__imul__</a>(y)&nbsp;&lt;==&gt;&nbsp;x*=y</tt></dd></dl>

<dl><dt><a name="Particle-__index__"><strong>__index__</strong></a>(...)</dt><dd><tt>x[y:z]&nbsp;&lt;==&gt;&nbsp;x[y.<a href="#Particle-__index__">__index__</a>():z.<a href="#Particle-__index__">__index__</a>()]</tt></dd></dl>

<dl><dt><a name="Particle-__int__"><strong>__int__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__int__">__int__</a>()&nbsp;&lt;==&gt;&nbsp;int(x)</tt></dd></dl>

<dl><dt><a name="Particle-__invert__"><strong>__invert__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__invert__">__invert__</a>()&nbsp;&lt;==&gt;&nbsp;~x</tt></dd></dl>

<dl><dt><a name="Particle-__ior__"><strong>__ior__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ior__">__ior__</a>(y)&nbsp;&lt;==&gt;&nbsp;x|=y</tt></dd></dl>

<dl><dt><a name="Particle-__ipow__"><strong>__ipow__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ipow__">__ipow__</a>(y)&nbsp;&lt;==&gt;&nbsp;x**=y</tt></dd></dl>

<dl><dt><a name="Particle-__irshift__"><strong>__irshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__irshift__">__irshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;&gt;=y</tt></dd></dl>

<dl><dt><a name="Particle-__isub__"><strong>__isub__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__isub__">__isub__</a>(y)&nbsp;&lt;==&gt;&nbsp;x-=y</tt></dd></dl>

<dl><dt><a name="Particle-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__iter__">__iter__</a>()&nbsp;&lt;==&gt;&nbsp;iter(x)</tt></dd></dl>

<dl><dt><a name="Particle-__itruediv__"><strong>__itruediv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__itruediv__">__itruediv__</a>(y)&nbsp;&lt;==&gt;&nbsp;x/y</tt></dd></dl>

<dl><dt><a name="Particle-__ixor__"><strong>__ixor__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ixor__">__ixor__</a>(y)&nbsp;&lt;==&gt;&nbsp;x^=y</tt></dd></dl>

<dl><dt><a name="Particle-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__le__">__le__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;=y</tt></dd></dl>

<dl><dt><a name="Particle-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__len__">__len__</a>()&nbsp;&lt;==&gt;&nbsp;len(x)</tt></dd></dl>

<dl><dt><a name="Particle-__lshift__"><strong>__lshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__lshift__">__lshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;&lt;y</tt></dd></dl>

<dl><dt><a name="Particle-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__lt__">__lt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;y</tt></dd></dl>

<dl><dt><a name="Particle-__mod__"><strong>__mod__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__mod__">__mod__</a>(y)&nbsp;&lt;==&gt;&nbsp;x%y</tt></dd></dl>

<dl><dt><a name="Particle-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__mul__">__mul__</a>(y)&nbsp;&lt;==&gt;&nbsp;x*y</tt></dd></dl>

<dl><dt><a name="Particle-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ne__">__ne__</a>(y)&nbsp;&lt;==&gt;&nbsp;x!=y</tt></dd></dl>

<dl><dt><a name="Particle-__neg__"><strong>__neg__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__neg__">__neg__</a>()&nbsp;&lt;==&gt;&nbsp;-x</tt></dd></dl>

<dl><dt><a name="Particle-__or__"><strong>__or__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__or__">__or__</a>(y)&nbsp;&lt;==&gt;&nbsp;x|y</tt></dd></dl>

<dl><dt><a name="Particle-__pos__"><strong>__pos__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__pos__">__pos__</a>()&nbsp;&lt;==&gt;&nbsp;+x</tt></dd></dl>

<dl><dt><a name="Particle-__pow__"><strong>__pow__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__pow__">__pow__</a>(y[,&nbsp;z])&nbsp;&lt;==&gt;&nbsp;pow(x,&nbsp;y[,&nbsp;z])</tt></dd></dl>

<dl><dt><a name="Particle-__radd__"><strong>__radd__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__radd__">__radd__</a>(y)&nbsp;&lt;==&gt;&nbsp;y+x</tt></dd></dl>

<dl><dt><a name="Particle-__rand__"><strong>__rand__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rand__">__rand__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&amp;x</tt></dd></dl>

<dl><dt><a name="Particle-__rdivmod__"><strong>__rdivmod__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rdivmod__">__rdivmod__</a>(y)&nbsp;&lt;==&gt;&nbsp;divmod(y,&nbsp;x)</tt></dd></dl>

<dl><dt><a name="Particle-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__reduce__">__reduce__</a>()<br>
&nbsp;<br>
For&nbsp;pickling.</tt></dd></dl>

<dl><dt><a name="Particle-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="Particle-__rfloordiv__"><strong>__rfloordiv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rfloordiv__">__rfloordiv__</a>(y)&nbsp;&lt;==&gt;&nbsp;y//x</tt></dd></dl>

<dl><dt><a name="Particle-__rlshift__"><strong>__rlshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rlshift__">__rlshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&lt;&lt;x</tt></dd></dl>

<dl><dt><a name="Particle-__rmod__"><strong>__rmod__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rmod__">__rmod__</a>(y)&nbsp;&lt;==&gt;&nbsp;y%x</tt></dd></dl>

<dl><dt><a name="Particle-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rmul__">__rmul__</a>(y)&nbsp;&lt;==&gt;&nbsp;y*x</tt></dd></dl>

<dl><dt><a name="Particle-__ror__"><strong>__ror__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__ror__">__ror__</a>(y)&nbsp;&lt;==&gt;&nbsp;y|x</tt></dd></dl>

<dl><dt><a name="Particle-__rpow__"><strong>__rpow__</strong></a>(...)</dt><dd><tt>y.<a href="#Particle-__rpow__">__rpow__</a>(x[,&nbsp;z])&nbsp;&lt;==&gt;&nbsp;pow(x,&nbsp;y[,&nbsp;z])</tt></dd></dl>

<dl><dt><a name="Particle-__rrshift__"><strong>__rrshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rrshift__">__rrshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&gt;&gt;x</tt></dd></dl>

<dl><dt><a name="Particle-__rshift__"><strong>__rshift__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rshift__">__rshift__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;&gt;y</tt></dd></dl>

<dl><dt><a name="Particle-__rsub__"><strong>__rsub__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rsub__">__rsub__</a>(y)&nbsp;&lt;==&gt;&nbsp;y-x</tt></dd></dl>

<dl><dt><a name="Particle-__rtruediv__"><strong>__rtruediv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rtruediv__">__rtruediv__</a>(y)&nbsp;&lt;==&gt;&nbsp;y/x</tt></dd></dl>

<dl><dt><a name="Particle-__rxor__"><strong>__rxor__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__rxor__">__rxor__</a>(y)&nbsp;&lt;==&gt;&nbsp;y^x</tt></dd></dl>

<dl><dt><a name="Particle-__setitem__"><strong>__setitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__setitem__">__setitem__</a>(i,&nbsp;y)&nbsp;&lt;==&gt;&nbsp;x[i]=y</tt></dd></dl>

<dl><dt><a name="Particle-__setstate__"><strong>__setstate__</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-__setstate__">__setstate__</a>(version,&nbsp;shape,&nbsp;dtype,&nbsp;isfortran,&nbsp;rawdata)<br>
&nbsp;<br>
For&nbsp;unpickling.<br>
&nbsp;<br>
Parameters<br>
----------<br>
version&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;optional&nbsp;pickle&nbsp;version.&nbsp;If&nbsp;omitted&nbsp;defaults&nbsp;to&nbsp;0.<br>
shape&nbsp;:&nbsp;tuple<br>
dtype&nbsp;:&nbsp;data-type<br>
isFortran&nbsp;:&nbsp;bool<br>
rawdata&nbsp;:&nbsp;string&nbsp;or&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;binary&nbsp;string&nbsp;with&nbsp;the&nbsp;data&nbsp;(or&nbsp;a&nbsp;list&nbsp;if&nbsp;'a'&nbsp;is&nbsp;an&nbsp;object&nbsp;array)</tt></dd></dl>

<dl><dt><a name="Particle-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>

<dl><dt><a name="Particle-__sub__"><strong>__sub__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__sub__">__sub__</a>(y)&nbsp;&lt;==&gt;&nbsp;x-y</tt></dd></dl>

<dl><dt><a name="Particle-__truediv__"><strong>__truediv__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__truediv__">__truediv__</a>(y)&nbsp;&lt;==&gt;&nbsp;x/y</tt></dd></dl>

<dl><dt><a name="Particle-__xor__"><strong>__xor__</strong></a>(...)</dt><dd><tt>x.<a href="#Particle-__xor__">__xor__</a>(y)&nbsp;&lt;==&gt;&nbsp;x^y</tt></dd></dl>

<dl><dt><a name="Particle-all"><strong>all</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-all">all</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;if&nbsp;all&nbsp;elements&nbsp;evaluate&nbsp;to&nbsp;True.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.all`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.all&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-any"><strong>any</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-any">any</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;elements&nbsp;of&nbsp;`a`&nbsp;evaluate&nbsp;to&nbsp;True.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.any`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.any&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-argmax"><strong>argmax</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-argmax">argmax</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;indices&nbsp;of&nbsp;the&nbsp;maximum&nbsp;values&nbsp;along&nbsp;the&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.argmax`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.argmax&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-argmin"><strong>argmin</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-argmin">argmin</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;indices&nbsp;of&nbsp;the&nbsp;minimum&nbsp;values&nbsp;along&nbsp;the&nbsp;given&nbsp;axis&nbsp;of&nbsp;`a`.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.argmin`&nbsp;for&nbsp;detailed&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.argmin&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-argsort"><strong>argsort</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-argsort">argsort</a>(axis=-1,&nbsp;kind='quicksort',&nbsp;order=None)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;indices&nbsp;that&nbsp;would&nbsp;sort&nbsp;this&nbsp;array.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.argsort`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.argsort&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-astype"><strong>astype</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-astype">astype</a>(dtype,&nbsp;order='K',&nbsp;casting='unsafe',&nbsp;subok=True,&nbsp;copy=True)<br>
&nbsp;<br>
Copy&nbsp;of&nbsp;the&nbsp;array,&nbsp;cast&nbsp;to&nbsp;a&nbsp;specified&nbsp;type.<br>
&nbsp;<br>
Parameters<br>
----------<br>
dtype&nbsp;:&nbsp;str&nbsp;or&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;Typecode&nbsp;or&nbsp;data-type&nbsp;to&nbsp;which&nbsp;the&nbsp;array&nbsp;is&nbsp;cast.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A',&nbsp;or&nbsp;'K'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;the&nbsp;memory&nbsp;layout&nbsp;order&nbsp;of&nbsp;the&nbsp;result.<br>
&nbsp;&nbsp;&nbsp;&nbsp;'C'&nbsp;means&nbsp;C&nbsp;order,&nbsp;'F'&nbsp;means&nbsp;Fortran&nbsp;order,&nbsp;'A'<br>
&nbsp;&nbsp;&nbsp;&nbsp;means&nbsp;'F'&nbsp;order&nbsp;if&nbsp;all&nbsp;the&nbsp;arrays&nbsp;are&nbsp;Fortran&nbsp;contiguous,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'C'&nbsp;order&nbsp;otherwise,&nbsp;and&nbsp;'K'&nbsp;means&nbsp;as&nbsp;close&nbsp;to&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;order&nbsp;the&nbsp;array&nbsp;elements&nbsp;appear&nbsp;in&nbsp;memory&nbsp;as&nbsp;possible.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Default&nbsp;is&nbsp;'K'.<br>
casting&nbsp;:&nbsp;{'no',&nbsp;'equiv',&nbsp;'safe',&nbsp;'same_kind',&nbsp;'unsafe'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;what&nbsp;kind&nbsp;of&nbsp;data&nbsp;casting&nbsp;may&nbsp;occur.&nbsp;Defaults&nbsp;to&nbsp;'unsafe'<br>
&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;backwards&nbsp;compatibility.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'no'&nbsp;means&nbsp;the&nbsp;data&nbsp;types&nbsp;should&nbsp;not&nbsp;be&nbsp;cast&nbsp;at&nbsp;all.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'equiv'&nbsp;means&nbsp;only&nbsp;byte-order&nbsp;changes&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'safe'&nbsp;means&nbsp;only&nbsp;casts&nbsp;which&nbsp;can&nbsp;preserve&nbsp;values&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'same_kind'&nbsp;means&nbsp;only&nbsp;safe&nbsp;casts&nbsp;or&nbsp;casts&nbsp;within&nbsp;a&nbsp;kind,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;float64&nbsp;to&nbsp;float32,&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'unsafe'&nbsp;means&nbsp;any&nbsp;data&nbsp;conversions&nbsp;may&nbsp;be&nbsp;done.<br>
subok&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;then&nbsp;sub-classes&nbsp;will&nbsp;be&nbsp;passed-through&nbsp;(default),&nbsp;otherwise<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;returned&nbsp;array&nbsp;will&nbsp;be&nbsp;forced&nbsp;to&nbsp;be&nbsp;a&nbsp;base-class&nbsp;array.<br>
copy&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;default,&nbsp;astype&nbsp;always&nbsp;returns&nbsp;a&nbsp;newly&nbsp;allocated&nbsp;array.&nbsp;If&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;set&nbsp;to&nbsp;false,&nbsp;and&nbsp;the&nbsp;`dtype`,&nbsp;`order`,&nbsp;and&nbsp;`subok`<br>
&nbsp;&nbsp;&nbsp;&nbsp;requirements&nbsp;are&nbsp;satisfied,&nbsp;the&nbsp;input&nbsp;array&nbsp;is&nbsp;returned&nbsp;instead<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;a&nbsp;copy.<br>
&nbsp;<br>
Raises<br>
------<br>
ComplexWarning&nbsp;:<br>
&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;casting&nbsp;from&nbsp;complex&nbsp;to&nbsp;float&nbsp;or&nbsp;int.&nbsp;To&nbsp;avoid&nbsp;this,<br>
&nbsp;&nbsp;&nbsp;&nbsp;one&nbsp;should&nbsp;use&nbsp;``a.real.<a href="#Particle-astype">astype</a>(t)``.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,&nbsp;2,&nbsp;2.5])<br>
&gt;&gt;&gt;&nbsp;x<br>
array([&nbsp;1.&nbsp;,&nbsp;&nbsp;2.&nbsp;,&nbsp;&nbsp;2.5])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-astype">astype</a>(int)<br>
array([1,&nbsp;2,&nbsp;2])</tt></dd></dl>

<dl><dt><a name="Particle-byteswap"><strong>byteswap</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-byteswap">byteswap</a>(inplace)<br>
&nbsp;<br>
Swap&nbsp;the&nbsp;bytes&nbsp;of&nbsp;the&nbsp;array&nbsp;elements<br>
&nbsp;<br>
Toggle&nbsp;between&nbsp;low-endian&nbsp;and&nbsp;big-endian&nbsp;data&nbsp;representation&nbsp;by<br>
returning&nbsp;a&nbsp;byteswapped&nbsp;array,&nbsp;optionally&nbsp;swapped&nbsp;in-place.<br>
&nbsp;<br>
Parameters<br>
----------<br>
inplace:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;``True``,&nbsp;swap&nbsp;bytes&nbsp;in-place,&nbsp;default&nbsp;is&nbsp;``False``.<br>
&nbsp;<br>
Returns<br>
-------<br>
out:&nbsp;<a href="numpy.html#ndarray">ndarray</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;byteswapped&nbsp;array.&nbsp;If&nbsp;`inplace`&nbsp;is&nbsp;``True``,&nbsp;this&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;view&nbsp;to&nbsp;self.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;A&nbsp;=&nbsp;np.array([1,&nbsp;256,&nbsp;8755],&nbsp;dtype=np.int16)<br>
&gt;&gt;&gt;&nbsp;map(hex,&nbsp;A)<br>
['0x1',&nbsp;'0x100',&nbsp;'0x2233']<br>
&gt;&gt;&gt;&nbsp;A.<a href="#Particle-byteswap">byteswap</a>(True)<br>
array([&nbsp;&nbsp;256,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,&nbsp;13090],&nbsp;dtype=int16)<br>
&gt;&gt;&gt;&nbsp;map(hex,&nbsp;A)<br>
['0x100',&nbsp;'0x1',&nbsp;'0x3322']<br>
&nbsp;<br>
Arrays&nbsp;of&nbsp;strings&nbsp;are&nbsp;not&nbsp;swapped<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;A&nbsp;=&nbsp;np.array(['ceg',&nbsp;'fac'])<br>
&gt;&gt;&gt;&nbsp;A.<a href="#Particle-byteswap">byteswap</a>()<br>
array(['ceg',&nbsp;'fac'],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype='|S3')</tt></dd></dl>

<dl><dt><a name="Particle-choose"><strong>choose</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-choose">choose</a>(choices,&nbsp;out=None,&nbsp;mode='raise')<br>
&nbsp;<br>
Use&nbsp;an&nbsp;index&nbsp;array&nbsp;to&nbsp;construct&nbsp;a&nbsp;new&nbsp;array&nbsp;from&nbsp;a&nbsp;set&nbsp;of&nbsp;choices.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.choose`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.choose&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-clip"><strong>clip</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-clip">clip</a>(a_min,&nbsp;a_max,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;an&nbsp;array&nbsp;whose&nbsp;values&nbsp;are&nbsp;limited&nbsp;to&nbsp;``[a_min,&nbsp;a_max]``.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.clip`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.clip&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-compress"><strong>compress</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-compress">compress</a>(condition,&nbsp;axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;selected&nbsp;slices&nbsp;of&nbsp;this&nbsp;array&nbsp;along&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.compress`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.compress&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-conj"><strong>conj</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-conj">conj</a>()<br>
&nbsp;<br>
Complex-conjugate&nbsp;all&nbsp;elements.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.conjugate`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.conjugate&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-conjugate"><strong>conjugate</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-conjugate">conjugate</a>()<br>
&nbsp;<br>
Return&nbsp;the&nbsp;complex&nbsp;conjugate,&nbsp;element-wise.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.conjugate`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.conjugate&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-copy"><strong>copy</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-copy">copy</a>(order='C')<br>
&nbsp;<br>
Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A',&nbsp;'K'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;the&nbsp;memory&nbsp;layout&nbsp;of&nbsp;the&nbsp;copy.&nbsp;'C'&nbsp;means&nbsp;C-order,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'F'&nbsp;means&nbsp;F-order,&nbsp;'A'&nbsp;means&nbsp;'F'&nbsp;if&nbsp;`a`&nbsp;is&nbsp;Fortran&nbsp;contiguous,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'C'&nbsp;otherwise.&nbsp;'K'&nbsp;means&nbsp;match&nbsp;the&nbsp;layout&nbsp;of&nbsp;`a`&nbsp;as&nbsp;closely<br>
&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;possible.&nbsp;(Note&nbsp;that&nbsp;this&nbsp;function&nbsp;and&nbsp;:func:numpy.copy&nbsp;are&nbsp;very<br>
&nbsp;&nbsp;&nbsp;&nbsp;similar,&nbsp;but&nbsp;have&nbsp;different&nbsp;default&nbsp;values&nbsp;for&nbsp;their&nbsp;order=<br>
&nbsp;&nbsp;&nbsp;&nbsp;arguments.)<br>
&nbsp;<br>
See&nbsp;also<br>
--------<br>
numpy.copy<br>
numpy.copyto<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([[1,2,3],[4,5,6]],&nbsp;order='F')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;x.<a href="#Particle-copy">copy</a>()<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-fill">fill</a>(0)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[0,&nbsp;0,&nbsp;0],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;0,&nbsp;0]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;y<br>
array([[1,&nbsp;2,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4,&nbsp;5,&nbsp;6]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;y.flags['C_CONTIGUOUS']<br>
True</tt></dd></dl>

<dl><dt><a name="Particle-cumprod"><strong>cumprod</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-cumprod">cumprod</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;cumulative&nbsp;product&nbsp;of&nbsp;the&nbsp;elements&nbsp;along&nbsp;the&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.cumprod`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.cumprod&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-cumsum"><strong>cumsum</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-cumsum">cumsum</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;cumulative&nbsp;sum&nbsp;of&nbsp;the&nbsp;elements&nbsp;along&nbsp;the&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.cumsum`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.cumsum&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-diagonal"><strong>diagonal</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-diagonal">diagonal</a>(offset=0,&nbsp;axis1=0,&nbsp;axis2=1)<br>
&nbsp;<br>
Return&nbsp;specified&nbsp;diagonals.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;:func:`numpy.diagonal`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.diagonal&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-dot"><strong>dot</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-dot">dot</a>(b,&nbsp;out=None)<br>
&nbsp;<br>
Dot&nbsp;product&nbsp;of&nbsp;two&nbsp;arrays.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.dot`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.dot&nbsp;:&nbsp;equivalent&nbsp;function<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.eye(2)<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.ones((2,&nbsp;2))&nbsp;*&nbsp;2<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-dot">dot</a>(b)<br>
array([[&nbsp;2.,&nbsp;&nbsp;2.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;2.,&nbsp;&nbsp;2.]])<br>
&nbsp;<br>
This&nbsp;array&nbsp;method&nbsp;can&nbsp;be&nbsp;conveniently&nbsp;chained:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-dot">dot</a>(b).<a href="#Particle-dot">dot</a>(b)<br>
array([[&nbsp;8.,&nbsp;&nbsp;8.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;8.,&nbsp;&nbsp;8.]])</tt></dd></dl>

<dl><dt><a name="Particle-dump"><strong>dump</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-dump">dump</a>(file)<br>
&nbsp;<br>
Dump&nbsp;a&nbsp;pickle&nbsp;of&nbsp;the&nbsp;array&nbsp;to&nbsp;the&nbsp;specified&nbsp;file.<br>
The&nbsp;array&nbsp;can&nbsp;be&nbsp;read&nbsp;back&nbsp;with&nbsp;pickle.load&nbsp;or&nbsp;numpy.load.<br>
&nbsp;<br>
Parameters<br>
----------<br>
file&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;string&nbsp;naming&nbsp;the&nbsp;dump&nbsp;file.</tt></dd></dl>

<dl><dt><a name="Particle-dumps"><strong>dumps</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-dumps">dumps</a>()<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;pickle&nbsp;of&nbsp;the&nbsp;array&nbsp;as&nbsp;a&nbsp;string.<br>
pickle.loads&nbsp;or&nbsp;numpy.loads&nbsp;will&nbsp;convert&nbsp;the&nbsp;string&nbsp;back&nbsp;to&nbsp;an&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
None</tt></dd></dl>

<dl><dt><a name="Particle-fill"><strong>fill</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-fill">fill</a>(value)<br>
&nbsp;<br>
Fill&nbsp;the&nbsp;array&nbsp;with&nbsp;a&nbsp;scalar&nbsp;value.<br>
&nbsp;<br>
Parameters<br>
----------<br>
value&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;elements&nbsp;of&nbsp;`a`&nbsp;will&nbsp;be&nbsp;assigned&nbsp;this&nbsp;value.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([1,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-fill">fill</a>(0)<br>
&gt;&gt;&gt;&nbsp;a<br>
array([0,&nbsp;0])<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.empty(2)<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-fill">fill</a>(1)<br>
&gt;&gt;&gt;&nbsp;a<br>
array([&nbsp;1.,&nbsp;&nbsp;1.])</tt></dd></dl>

<dl><dt><a name="Particle-flatten"><strong>flatten</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-flatten">flatten</a>(order='C')<br>
&nbsp;<br>
Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;array&nbsp;collapsed&nbsp;into&nbsp;one&nbsp;dimension.<br>
&nbsp;<br>
Parameters<br>
----------<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Whether&nbsp;to&nbsp;flatten&nbsp;in&nbsp;C&nbsp;(row-major),&nbsp;Fortran&nbsp;(column-major)&nbsp;order,<br>
&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;preserve&nbsp;the&nbsp;C/Fortran&nbsp;ordering&nbsp;from&nbsp;`a`.<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;is&nbsp;'C'.<br>
&nbsp;<br>
Returns<br>
-------<br>
y&nbsp;:&nbsp;<a href="numpy.html#ndarray">ndarray</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;copy&nbsp;of&nbsp;the&nbsp;input&nbsp;array,&nbsp;flattened&nbsp;to&nbsp;one&nbsp;dimension.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
ravel&nbsp;:&nbsp;Return&nbsp;a&nbsp;flattened&nbsp;array.<br>
flat&nbsp;:&nbsp;A&nbsp;1-D&nbsp;flat&nbsp;iterator&nbsp;over&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[1,2],&nbsp;[3,4]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-flatten">flatten</a>()<br>
array([1,&nbsp;2,&nbsp;3,&nbsp;4])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-flatten">flatten</a>('F')<br>
array([1,&nbsp;3,&nbsp;2,&nbsp;4])</tt></dd></dl>

<dl><dt><a name="Particle-getfield"><strong>getfield</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-getfield">getfield</a>(dtype,&nbsp;offset=0)<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;field&nbsp;of&nbsp;the&nbsp;given&nbsp;array&nbsp;as&nbsp;a&nbsp;certain&nbsp;type.<br>
&nbsp;<br>
A&nbsp;field&nbsp;is&nbsp;a&nbsp;view&nbsp;of&nbsp;the&nbsp;array&nbsp;data&nbsp;with&nbsp;a&nbsp;given&nbsp;data-type.&nbsp;The&nbsp;values&nbsp;in<br>
the&nbsp;view&nbsp;are&nbsp;determined&nbsp;by&nbsp;the&nbsp;given&nbsp;type&nbsp;and&nbsp;the&nbsp;offset&nbsp;into&nbsp;the&nbsp;current<br>
array&nbsp;in&nbsp;bytes.&nbsp;The&nbsp;offset&nbsp;needs&nbsp;to&nbsp;be&nbsp;such&nbsp;that&nbsp;the&nbsp;view&nbsp;dtype&nbsp;fits&nbsp;in&nbsp;the<br>
array&nbsp;dtype;&nbsp;for&nbsp;example&nbsp;an&nbsp;array&nbsp;of&nbsp;dtype&nbsp;complex128&nbsp;has&nbsp;16-byte&nbsp;elements.<br>
If&nbsp;taking&nbsp;a&nbsp;view&nbsp;with&nbsp;a&nbsp;32-bit&nbsp;integer&nbsp;(4&nbsp;bytes),&nbsp;the&nbsp;offset&nbsp;needs&nbsp;to&nbsp;be<br>
between&nbsp;0&nbsp;and&nbsp;12&nbsp;bytes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
dtype&nbsp;:&nbsp;str&nbsp;or&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;type&nbsp;of&nbsp;the&nbsp;view.&nbsp;The&nbsp;dtype&nbsp;size&nbsp;of&nbsp;the&nbsp;view&nbsp;can&nbsp;not&nbsp;be&nbsp;larger<br>
&nbsp;&nbsp;&nbsp;&nbsp;than&nbsp;that&nbsp;of&nbsp;the&nbsp;array&nbsp;itself.<br>
offset&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;skip&nbsp;before&nbsp;beginning&nbsp;the&nbsp;element&nbsp;view.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.diag([1.+1.j]*2)<br>
&gt;&gt;&gt;&nbsp;x[1,&nbsp;1]&nbsp;=&nbsp;2&nbsp;+&nbsp;4.j<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[&nbsp;1.+1.j,&nbsp;&nbsp;0.+0.j],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.+0.j,&nbsp;&nbsp;2.+4.j]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-getfield">getfield</a>(np.float64)<br>
array([[&nbsp;1.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;2.]])<br>
&nbsp;<br>
By&nbsp;choosing&nbsp;an&nbsp;offset&nbsp;of&nbsp;8&nbsp;bytes&nbsp;we&nbsp;can&nbsp;select&nbsp;the&nbsp;complex&nbsp;part&nbsp;of&nbsp;the<br>
array&nbsp;for&nbsp;our&nbsp;view:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-getfield">getfield</a>(np.float64,&nbsp;offset=8)<br>
array([[&nbsp;1.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;4.]])</tt></dd></dl>

<dl><dt><a name="Particle-item"><strong>item</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-item">item</a>(*args)<br>
&nbsp;<br>
Copy&nbsp;an&nbsp;element&nbsp;of&nbsp;an&nbsp;array&nbsp;to&nbsp;a&nbsp;standard&nbsp;Python&nbsp;scalar&nbsp;and&nbsp;return&nbsp;it.<br>
&nbsp;<br>
Parameters<br>
----------<br>
\*args&nbsp;:&nbsp;Arguments&nbsp;(variable&nbsp;number&nbsp;and&nbsp;type)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;none:&nbsp;in&nbsp;this&nbsp;case,&nbsp;the&nbsp;method&nbsp;only&nbsp;works&nbsp;for&nbsp;arrays<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;one&nbsp;element&nbsp;(`a.size&nbsp;==&nbsp;1`),&nbsp;which&nbsp;element&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;copied&nbsp;into&nbsp;a&nbsp;standard&nbsp;Python&nbsp;scalar&nbsp;object&nbsp;and&nbsp;returned.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;int_type:&nbsp;this&nbsp;argument&nbsp;is&nbsp;interpreted&nbsp;as&nbsp;a&nbsp;flat&nbsp;index&nbsp;into<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;array,&nbsp;specifying&nbsp;which&nbsp;element&nbsp;to&nbsp;copy&nbsp;and&nbsp;return.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;tuple&nbsp;of&nbsp;int_types:&nbsp;functions&nbsp;as&nbsp;does&nbsp;a&nbsp;single&nbsp;int_type&nbsp;argument,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;that&nbsp;the&nbsp;argument&nbsp;is&nbsp;interpreted&nbsp;as&nbsp;an&nbsp;nd-index&nbsp;into&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array.<br>
&nbsp;<br>
Returns<br>
-------<br>
z&nbsp;:&nbsp;Standard&nbsp;Python&nbsp;scalar&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;copy&nbsp;of&nbsp;the&nbsp;specified&nbsp;element&nbsp;of&nbsp;the&nbsp;array&nbsp;as&nbsp;a&nbsp;suitable<br>
&nbsp;&nbsp;&nbsp;&nbsp;Python&nbsp;scalar<br>
&nbsp;<br>
Notes<br>
-----<br>
When&nbsp;the&nbsp;data&nbsp;type&nbsp;of&nbsp;`a`&nbsp;is&nbsp;longdouble&nbsp;or&nbsp;clongdouble,&nbsp;<a href="#Particle-item">item</a>()&nbsp;returns<br>
a&nbsp;scalar&nbsp;array&nbsp;object&nbsp;because&nbsp;there&nbsp;is&nbsp;no&nbsp;available&nbsp;Python&nbsp;scalar&nbsp;that<br>
would&nbsp;not&nbsp;lose&nbsp;information.&nbsp;Void&nbsp;arrays&nbsp;return&nbsp;a&nbsp;buffer&nbsp;object&nbsp;for&nbsp;<a href="#Particle-item">item</a>(),<br>
unless&nbsp;fields&nbsp;are&nbsp;defined,&nbsp;in&nbsp;which&nbsp;case&nbsp;a&nbsp;tuple&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
`item`&nbsp;is&nbsp;very&nbsp;similar&nbsp;to&nbsp;a[args],&nbsp;except,&nbsp;instead&nbsp;of&nbsp;an&nbsp;array&nbsp;scalar,<br>
a&nbsp;standard&nbsp;Python&nbsp;scalar&nbsp;is&nbsp;returned.&nbsp;This&nbsp;can&nbsp;be&nbsp;useful&nbsp;for&nbsp;speeding&nbsp;up<br>
access&nbsp;to&nbsp;elements&nbsp;of&nbsp;the&nbsp;array&nbsp;and&nbsp;doing&nbsp;arithmetic&nbsp;on&nbsp;elements&nbsp;of&nbsp;the<br>
array&nbsp;using&nbsp;Python's&nbsp;optimized&nbsp;math.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.random.randint(9,&nbsp;size=(3,&nbsp;3))<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[3,&nbsp;1,&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;8,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[8,&nbsp;5,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-item">item</a>(3)<br>
2<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-item">item</a>(7)<br>
5<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-item">item</a>((0,&nbsp;1))<br>
1<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-item">item</a>((2,&nbsp;2))<br>
3</tt></dd></dl>

<dl><dt><a name="Particle-itemset"><strong>itemset</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-itemset">itemset</a>(*args)<br>
&nbsp;<br>
Insert&nbsp;scalar&nbsp;into&nbsp;an&nbsp;array&nbsp;(scalar&nbsp;is&nbsp;cast&nbsp;to&nbsp;array's&nbsp;dtype,&nbsp;if&nbsp;possible)<br>
&nbsp;<br>
There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;1&nbsp;argument,&nbsp;and&nbsp;define&nbsp;the&nbsp;last&nbsp;argument<br>
as&nbsp;*item*.&nbsp;&nbsp;Then,&nbsp;``a.<a href="#Particle-itemset">itemset</a>(*args)``&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;but&nbsp;faster<br>
than&nbsp;``a[args]&nbsp;=&nbsp;item``.&nbsp;&nbsp;The&nbsp;item&nbsp;should&nbsp;be&nbsp;a&nbsp;scalar&nbsp;value&nbsp;and&nbsp;`args`<br>
must&nbsp;select&nbsp;a&nbsp;single&nbsp;item&nbsp;in&nbsp;the&nbsp;array&nbsp;`a`.<br>
&nbsp;<br>
Parameters<br>
----------<br>
\*args&nbsp;:&nbsp;Arguments<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;one&nbsp;argument:&nbsp;a&nbsp;scalar,&nbsp;only&nbsp;used&nbsp;in&nbsp;case&nbsp;`a`&nbsp;is&nbsp;of&nbsp;size&nbsp;1.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;two&nbsp;arguments:&nbsp;the&nbsp;last&nbsp;argument&nbsp;is&nbsp;the&nbsp;value&nbsp;to&nbsp;be&nbsp;set<br>
&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;must&nbsp;be&nbsp;a&nbsp;scalar,&nbsp;the&nbsp;first&nbsp;argument&nbsp;specifies&nbsp;a&nbsp;single&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;element&nbsp;location.&nbsp;It&nbsp;is&nbsp;either&nbsp;an&nbsp;int&nbsp;or&nbsp;a&nbsp;tuple.<br>
&nbsp;<br>
Notes<br>
-----<br>
Compared&nbsp;to&nbsp;indexing&nbsp;syntax,&nbsp;`itemset`&nbsp;provides&nbsp;some&nbsp;speed&nbsp;increase<br>
for&nbsp;placing&nbsp;a&nbsp;scalar&nbsp;into&nbsp;a&nbsp;particular&nbsp;location&nbsp;in&nbsp;an&nbsp;`<a href="numpy.html#ndarray">ndarray</a>`,<br>
if&nbsp;you&nbsp;must&nbsp;do&nbsp;this.&nbsp;&nbsp;However,&nbsp;generally&nbsp;this&nbsp;is&nbsp;discouraged:<br>
among&nbsp;other&nbsp;problems,&nbsp;it&nbsp;complicates&nbsp;the&nbsp;appearance&nbsp;of&nbsp;the&nbsp;code.<br>
Also,&nbsp;when&nbsp;using&nbsp;`itemset`&nbsp;(and&nbsp;`item`)&nbsp;inside&nbsp;a&nbsp;loop,&nbsp;be&nbsp;sure<br>
to&nbsp;assign&nbsp;the&nbsp;methods&nbsp;to&nbsp;a&nbsp;local&nbsp;variable&nbsp;to&nbsp;avoid&nbsp;the&nbsp;attribute<br>
look-up&nbsp;at&nbsp;each&nbsp;loop&nbsp;iteration.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.random.randint(9,&nbsp;size=(3,&nbsp;3))<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[3,&nbsp;1,&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;8,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[8,&nbsp;5,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-itemset">itemset</a>(4,&nbsp;0)<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-itemset">itemset</a>((2,&nbsp;2),&nbsp;9)<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[3,&nbsp;1,&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;0,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[8,&nbsp;5,&nbsp;9]])</tt></dd></dl>

<dl><dt><a name="Particle-max"><strong>max</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-max">max</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;maximum&nbsp;along&nbsp;a&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.amax`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.amax&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-mean"><strong>mean</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-mean">mean</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;average&nbsp;of&nbsp;the&nbsp;array&nbsp;elements&nbsp;along&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.mean`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.mean&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-min"><strong>min</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-min">min</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;minimum&nbsp;along&nbsp;a&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.amin`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.amin&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-newbyteorder"><strong>newbyteorder</strong></a>(...)</dt><dd><tt>arr.<a href="#Particle-newbyteorder">newbyteorder</a>(new_order='S')<br>
&nbsp;<br>
Return&nbsp;the&nbsp;array&nbsp;with&nbsp;the&nbsp;same&nbsp;data&nbsp;viewed&nbsp;with&nbsp;a&nbsp;different&nbsp;byte&nbsp;order.<br>
&nbsp;<br>
Equivalent&nbsp;to::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;arr.<a href="#Particle-view">view</a>(arr.dtype.newbytorder(new_order))<br>
&nbsp;<br>
Changes&nbsp;are&nbsp;also&nbsp;made&nbsp;in&nbsp;all&nbsp;fields&nbsp;and&nbsp;sub-arrays&nbsp;of&nbsp;the&nbsp;array&nbsp;data<br>
type.<br>
&nbsp;<br>
&nbsp;<br>
&nbsp;<br>
Parameters<br>
----------<br>
new_order&nbsp;:&nbsp;string,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;order&nbsp;to&nbsp;force;&nbsp;a&nbsp;value&nbsp;from&nbsp;the&nbsp;byte&nbsp;order&nbsp;specifications<br>
&nbsp;&nbsp;&nbsp;&nbsp;above.&nbsp;`new_order`&nbsp;codes&nbsp;can&nbsp;be&nbsp;any&nbsp;of::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'S'&nbsp;-&nbsp;swap&nbsp;dtype&nbsp;from&nbsp;current&nbsp;to&nbsp;opposite&nbsp;endian<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{'&lt;',&nbsp;'L'}&nbsp;-&nbsp;little&nbsp;endian<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{'&gt;',&nbsp;'B'}&nbsp;-&nbsp;big&nbsp;endian<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{'=',&nbsp;'N'}&nbsp;-&nbsp;native&nbsp;order<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{'|',&nbsp;'I'}&nbsp;-&nbsp;ignore&nbsp;(no&nbsp;change&nbsp;to&nbsp;byte&nbsp;order)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;value&nbsp;('S')&nbsp;results&nbsp;in&nbsp;swapping&nbsp;the&nbsp;current<br>
&nbsp;&nbsp;&nbsp;&nbsp;byte&nbsp;order.&nbsp;The&nbsp;code&nbsp;does&nbsp;a&nbsp;case-insensitive&nbsp;check&nbsp;on&nbsp;the&nbsp;first<br>
&nbsp;&nbsp;&nbsp;&nbsp;letter&nbsp;of&nbsp;`new_order`&nbsp;for&nbsp;the&nbsp;alternatives&nbsp;above.&nbsp;&nbsp;For&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;any&nbsp;of&nbsp;'B'&nbsp;or&nbsp;'b'&nbsp;or&nbsp;'biggish'&nbsp;are&nbsp;valid&nbsp;to&nbsp;specify&nbsp;big-endian.<br>
&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
new_arr&nbsp;:&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;New&nbsp;array&nbsp;object&nbsp;with&nbsp;the&nbsp;dtype&nbsp;reflecting&nbsp;given&nbsp;change&nbsp;to&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;byte&nbsp;order.</tt></dd></dl>

<dl><dt><a name="Particle-nonzero"><strong>nonzero</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-nonzero">nonzero</a>()<br>
&nbsp;<br>
Return&nbsp;the&nbsp;indices&nbsp;of&nbsp;the&nbsp;elements&nbsp;that&nbsp;are&nbsp;non-zero.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.nonzero`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.nonzero&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-prod"><strong>prod</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-prod">prod</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;product&nbsp;of&nbsp;the&nbsp;array&nbsp;elements&nbsp;over&nbsp;the&nbsp;given&nbsp;axis<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.prod`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.prod&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-ptp"><strong>ptp</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-ptp">ptp</a>(axis=None,&nbsp;out=None)<br>
&nbsp;<br>
Peak&nbsp;to&nbsp;peak&nbsp;(maximum&nbsp;-&nbsp;minimum)&nbsp;value&nbsp;along&nbsp;a&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.ptp`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.ptp&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-put"><strong>put</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-put">put</a>(indices,&nbsp;values,&nbsp;mode='raise')<br>
&nbsp;<br>
Set&nbsp;``a.flat[n]&nbsp;=&nbsp;values[n]``&nbsp;for&nbsp;all&nbsp;`n`&nbsp;in&nbsp;indices.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.put`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.put&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-ravel"><strong>ravel</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-ravel">ravel</a>([order])<br>
&nbsp;<br>
Return&nbsp;a&nbsp;flattened&nbsp;array.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.ravel`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.ravel&nbsp;:&nbsp;equivalent&nbsp;function<br>
&nbsp;<br>
<a href="numpy.html#ndarray">ndarray</a>.flat&nbsp;:&nbsp;a&nbsp;flat&nbsp;iterator&nbsp;on&nbsp;the&nbsp;array.</tt></dd></dl>

<dl><dt><a name="Particle-repeat"><strong>repeat</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-repeat">repeat</a>(repeats,&nbsp;axis=None)<br>
&nbsp;<br>
Repeat&nbsp;elements&nbsp;of&nbsp;an&nbsp;array.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.repeat`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.repeat&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-reshape"><strong>reshape</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-reshape">reshape</a>(shape,&nbsp;order='C')<br>
&nbsp;<br>
Returns&nbsp;an&nbsp;array&nbsp;containing&nbsp;the&nbsp;same&nbsp;data&nbsp;with&nbsp;a&nbsp;new&nbsp;shape.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.reshape`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.reshape&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-resize"><strong>resize</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-resize">resize</a>(new_shape,&nbsp;refcheck=True)<br>
&nbsp;<br>
Change&nbsp;shape&nbsp;and&nbsp;size&nbsp;of&nbsp;array&nbsp;in-place.<br>
&nbsp;<br>
Parameters<br>
----------<br>
new_shape&nbsp;:&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;or&nbsp;`n`&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Shape&nbsp;of&nbsp;resized&nbsp;array.<br>
refcheck&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False,&nbsp;reference&nbsp;count&nbsp;will&nbsp;not&nbsp;be&nbsp;checked.&nbsp;Default&nbsp;is&nbsp;True.<br>
&nbsp;<br>
Returns<br>
-------<br>
None<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`a`&nbsp;does&nbsp;not&nbsp;own&nbsp;its&nbsp;own&nbsp;data&nbsp;or&nbsp;references&nbsp;or&nbsp;views&nbsp;to&nbsp;it&nbsp;exist,<br>
&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;the&nbsp;data&nbsp;memory&nbsp;must&nbsp;be&nbsp;changed.<br>
&nbsp;<br>
SystemError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;`order`&nbsp;keyword&nbsp;argument&nbsp;is&nbsp;specified.&nbsp;This&nbsp;behaviour&nbsp;is&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;bug&nbsp;in&nbsp;NumPy.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
resize&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;array&nbsp;with&nbsp;the&nbsp;specified&nbsp;shape.<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;reallocates&nbsp;space&nbsp;for&nbsp;the&nbsp;data&nbsp;area&nbsp;if&nbsp;necessary.<br>
&nbsp;<br>
Only&nbsp;contiguous&nbsp;arrays&nbsp;(data&nbsp;elements&nbsp;consecutive&nbsp;in&nbsp;memory)&nbsp;can&nbsp;be<br>
resized.<br>
&nbsp;<br>
The&nbsp;purpose&nbsp;of&nbsp;the&nbsp;reference&nbsp;count&nbsp;check&nbsp;is&nbsp;to&nbsp;make&nbsp;sure&nbsp;you<br>
do&nbsp;not&nbsp;use&nbsp;this&nbsp;array&nbsp;as&nbsp;a&nbsp;buffer&nbsp;for&nbsp;another&nbsp;Python&nbsp;object&nbsp;and&nbsp;then<br>
reallocate&nbsp;the&nbsp;memory.&nbsp;However,&nbsp;reference&nbsp;counts&nbsp;can&nbsp;increase&nbsp;in<br>
other&nbsp;ways&nbsp;so&nbsp;if&nbsp;you&nbsp;are&nbsp;sure&nbsp;that&nbsp;you&nbsp;have&nbsp;not&nbsp;shared&nbsp;the&nbsp;memory<br>
for&nbsp;this&nbsp;array&nbsp;with&nbsp;another&nbsp;Python&nbsp;object,&nbsp;then&nbsp;you&nbsp;may&nbsp;safely&nbsp;set<br>
`refcheck`&nbsp;to&nbsp;False.<br>
&nbsp;<br>
Examples<br>
--------<br>
Shrinking&nbsp;an&nbsp;array:&nbsp;array&nbsp;is&nbsp;flattened&nbsp;(in&nbsp;the&nbsp;order&nbsp;that&nbsp;the&nbsp;data&nbsp;are<br>
stored&nbsp;in&nbsp;memory),&nbsp;resized,&nbsp;and&nbsp;reshaped:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[0,&nbsp;1],&nbsp;[2,&nbsp;3]],&nbsp;order='C')<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-resize">resize</a>((2,&nbsp;1))<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[0],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[0,&nbsp;1],&nbsp;[2,&nbsp;3]],&nbsp;order='F')<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-resize">resize</a>((2,&nbsp;1))<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[0],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2]])<br>
&nbsp;<br>
Enlarging&nbsp;an&nbsp;array:&nbsp;as&nbsp;above,&nbsp;but&nbsp;missing&nbsp;entries&nbsp;are&nbsp;filled&nbsp;with&nbsp;zeros:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.array([[0,&nbsp;1],&nbsp;[2,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;b.<a href="#Particle-resize">resize</a>(2,&nbsp;3)&nbsp;#&nbsp;new_shape&nbsp;parameter&nbsp;doesn't&nbsp;have&nbsp;to&nbsp;be&nbsp;a&nbsp;tuple<br>
&gt;&gt;&gt;&nbsp;b<br>
array([[0,&nbsp;1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;0,&nbsp;0]])<br>
&nbsp;<br>
Referencing&nbsp;an&nbsp;array&nbsp;prevents&nbsp;resizing...<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;a<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-resize">resize</a>((1,&nbsp;1))<br>
Traceback&nbsp;(most&nbsp;recent&nbsp;call&nbsp;last):<br>
...<br>
ValueError:&nbsp;cannot&nbsp;resize&nbsp;an&nbsp;array&nbsp;that&nbsp;has&nbsp;been&nbsp;referenced&nbsp;...<br>
&nbsp;<br>
Unless&nbsp;`refcheck`&nbsp;is&nbsp;False:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-resize">resize</a>((1,&nbsp;1),&nbsp;refcheck=False)<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[0]])<br>
&gt;&gt;&gt;&nbsp;c<br>
array([[0]])</tt></dd></dl>

<dl><dt><a name="Particle-round"><strong>round</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-round">round</a>(decimals=0,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;`a`&nbsp;with&nbsp;each&nbsp;element&nbsp;rounded&nbsp;to&nbsp;the&nbsp;given&nbsp;number&nbsp;of&nbsp;decimals.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.around`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.around&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-searchsorted"><strong>searchsorted</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-searchsorted">searchsorted</a>(v,&nbsp;side='left',&nbsp;sorter=None)<br>
&nbsp;<br>
Find&nbsp;indices&nbsp;where&nbsp;elements&nbsp;of&nbsp;v&nbsp;should&nbsp;be&nbsp;inserted&nbsp;in&nbsp;a&nbsp;to&nbsp;maintain&nbsp;order.<br>
&nbsp;<br>
For&nbsp;full&nbsp;documentation,&nbsp;see&nbsp;`numpy.searchsorted`<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.searchsorted&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-setfield"><strong>setfield</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-setfield">setfield</a>(val,&nbsp;dtype,&nbsp;offset=0)<br>
&nbsp;<br>
Put&nbsp;a&nbsp;value&nbsp;into&nbsp;a&nbsp;specified&nbsp;place&nbsp;in&nbsp;a&nbsp;field&nbsp;defined&nbsp;by&nbsp;a&nbsp;data-type.<br>
&nbsp;<br>
Place&nbsp;`val`&nbsp;into&nbsp;`a`'s&nbsp;field&nbsp;defined&nbsp;by&nbsp;`dtype`&nbsp;and&nbsp;beginning&nbsp;`offset`<br>
bytes&nbsp;into&nbsp;the&nbsp;field.<br>
&nbsp;<br>
Parameters<br>
----------<br>
val&nbsp;:&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;Value&nbsp;to&nbsp;be&nbsp;placed&nbsp;in&nbsp;field.<br>
dtype&nbsp;:&nbsp;dtype&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data-type&nbsp;of&nbsp;the&nbsp;field&nbsp;in&nbsp;which&nbsp;to&nbsp;place&nbsp;`val`.<br>
offset&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;bytes&nbsp;into&nbsp;the&nbsp;field&nbsp;at&nbsp;which&nbsp;to&nbsp;place&nbsp;`val`.<br>
&nbsp;<br>
Returns<br>
-------<br>
None<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
getfield<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.eye(3)<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-getfield">getfield</a>(np.float64)<br>
array([[&nbsp;1.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;1.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;1.]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-setfield">setfield</a>(3,&nbsp;np.int32)<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-getfield">getfield</a>(np.int32)<br>
array([[3,&nbsp;3,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;3,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;3,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[&nbsp;&nbsp;1.00000000e+000,&nbsp;&nbsp;&nbsp;1.48219694e-323,&nbsp;&nbsp;&nbsp;1.48219694e-323],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;1.48219694e-323,&nbsp;&nbsp;&nbsp;1.00000000e+000,&nbsp;&nbsp;&nbsp;1.48219694e-323],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;1.48219694e-323,&nbsp;&nbsp;&nbsp;1.48219694e-323,&nbsp;&nbsp;&nbsp;1.00000000e+000]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-setfield">setfield</a>(np.eye(3),&nbsp;np.int32)<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[&nbsp;1.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;1.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;1.]])</tt></dd></dl>

<dl><dt><a name="Particle-setflags"><strong>setflags</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-setflags">setflags</a>(write=None,&nbsp;align=None,&nbsp;uic=None)<br>
&nbsp;<br>
Set&nbsp;array&nbsp;flags&nbsp;WRITEABLE,&nbsp;ALIGNED,&nbsp;and&nbsp;UPDATEIFCOPY,&nbsp;respectively.<br>
&nbsp;<br>
These&nbsp;Boolean-valued&nbsp;flags&nbsp;affect&nbsp;how&nbsp;numpy&nbsp;interprets&nbsp;the&nbsp;memory<br>
area&nbsp;used&nbsp;by&nbsp;`a`&nbsp;(see&nbsp;Notes&nbsp;below).&nbsp;The&nbsp;ALIGNED&nbsp;flag&nbsp;can&nbsp;only<br>
be&nbsp;set&nbsp;to&nbsp;True&nbsp;if&nbsp;the&nbsp;data&nbsp;is&nbsp;actually&nbsp;aligned&nbsp;according&nbsp;to&nbsp;the&nbsp;type.<br>
The&nbsp;UPDATEIFCOPY&nbsp;flag&nbsp;can&nbsp;never&nbsp;be&nbsp;set&nbsp;to&nbsp;True.&nbsp;The&nbsp;flag&nbsp;WRITEABLE<br>
can&nbsp;only&nbsp;be&nbsp;set&nbsp;to&nbsp;True&nbsp;if&nbsp;the&nbsp;array&nbsp;owns&nbsp;its&nbsp;own&nbsp;memory,&nbsp;or&nbsp;the<br>
ultimate&nbsp;owner&nbsp;of&nbsp;the&nbsp;memory&nbsp;exposes&nbsp;a&nbsp;writeable&nbsp;buffer&nbsp;interface,<br>
or&nbsp;is&nbsp;a&nbsp;string.&nbsp;(The&nbsp;exception&nbsp;for&nbsp;string&nbsp;is&nbsp;made&nbsp;so&nbsp;that&nbsp;unpickling<br>
can&nbsp;be&nbsp;done&nbsp;without&nbsp;copying&nbsp;memory.)<br>
&nbsp;<br>
Parameters<br>
----------<br>
write&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Describes&nbsp;whether&nbsp;or&nbsp;not&nbsp;`a`&nbsp;can&nbsp;be&nbsp;written&nbsp;to.<br>
align&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Describes&nbsp;whether&nbsp;or&nbsp;not&nbsp;`a`&nbsp;is&nbsp;aligned&nbsp;properly&nbsp;for&nbsp;its&nbsp;type.<br>
uic&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Describes&nbsp;whether&nbsp;or&nbsp;not&nbsp;`a`&nbsp;is&nbsp;a&nbsp;copy&nbsp;of&nbsp;another&nbsp;"base"&nbsp;array.<br>
&nbsp;<br>
Notes<br>
-----<br>
Array&nbsp;flags&nbsp;provide&nbsp;information&nbsp;about&nbsp;how&nbsp;the&nbsp;memory&nbsp;area&nbsp;used<br>
for&nbsp;the&nbsp;array&nbsp;is&nbsp;to&nbsp;be&nbsp;interpreted.&nbsp;There&nbsp;are&nbsp;6&nbsp;Boolean&nbsp;flags<br>
in&nbsp;use,&nbsp;only&nbsp;three&nbsp;of&nbsp;which&nbsp;can&nbsp;be&nbsp;changed&nbsp;by&nbsp;the&nbsp;user:<br>
UPDATEIFCOPY,&nbsp;WRITEABLE,&nbsp;and&nbsp;ALIGNED.<br>
&nbsp;<br>
WRITEABLE&nbsp;(W)&nbsp;the&nbsp;data&nbsp;area&nbsp;can&nbsp;be&nbsp;written&nbsp;to;<br>
&nbsp;<br>
ALIGNED&nbsp;(A)&nbsp;the&nbsp;data&nbsp;and&nbsp;strides&nbsp;are&nbsp;aligned&nbsp;appropriately&nbsp;for&nbsp;the&nbsp;hardware<br>
(as&nbsp;determined&nbsp;by&nbsp;the&nbsp;compiler);<br>
&nbsp;<br>
UPDATEIFCOPY&nbsp;(U)&nbsp;this&nbsp;array&nbsp;is&nbsp;a&nbsp;copy&nbsp;of&nbsp;some&nbsp;other&nbsp;array&nbsp;(referenced<br>
by&nbsp;.base).&nbsp;When&nbsp;this&nbsp;array&nbsp;is&nbsp;deallocated,&nbsp;the&nbsp;base&nbsp;array&nbsp;will&nbsp;be<br>
updated&nbsp;with&nbsp;the&nbsp;contents&nbsp;of&nbsp;this&nbsp;array.<br>
&nbsp;<br>
All&nbsp;flags&nbsp;can&nbsp;be&nbsp;accessed&nbsp;using&nbsp;their&nbsp;first&nbsp;(upper&nbsp;case)&nbsp;letter&nbsp;as&nbsp;well<br>
as&nbsp;the&nbsp;full&nbsp;name.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;y<br>
array([[3,&nbsp;1,&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;0,&nbsp;0],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[8,&nbsp;5,&nbsp;9]])<br>
&gt;&gt;&gt;&nbsp;y.flags<br>
&nbsp;&nbsp;C_CONTIGUOUS&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;F_CONTIGUOUS&nbsp;:&nbsp;False<br>
&nbsp;&nbsp;OWNDATA&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;WRITEABLE&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;ALIGNED&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;UPDATEIFCOPY&nbsp;:&nbsp;False<br>
&gt;&gt;&gt;&nbsp;y.<a href="#Particle-setflags">setflags</a>(write=0,&nbsp;align=0)<br>
&gt;&gt;&gt;&nbsp;y.flags<br>
&nbsp;&nbsp;C_CONTIGUOUS&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;F_CONTIGUOUS&nbsp;:&nbsp;False<br>
&nbsp;&nbsp;OWNDATA&nbsp;:&nbsp;True<br>
&nbsp;&nbsp;WRITEABLE&nbsp;:&nbsp;False<br>
&nbsp;&nbsp;ALIGNED&nbsp;:&nbsp;False<br>
&nbsp;&nbsp;UPDATEIFCOPY&nbsp;:&nbsp;False<br>
&gt;&gt;&gt;&nbsp;y.<a href="#Particle-setflags">setflags</a>(uic=1)<br>
Traceback&nbsp;(most&nbsp;recent&nbsp;call&nbsp;last):<br>
&nbsp;&nbsp;File&nbsp;"&lt;stdin&gt;",&nbsp;line&nbsp;1,&nbsp;in&nbsp;&lt;module&gt;<br>
ValueError:&nbsp;cannot&nbsp;set&nbsp;UPDATEIFCOPY&nbsp;flag&nbsp;to&nbsp;True</tt></dd></dl>

<dl><dt><a name="Particle-sort"><strong>sort</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-sort">sort</a>(axis=-1,&nbsp;kind='quicksort',&nbsp;order=None)<br>
&nbsp;<br>
Sort&nbsp;an&nbsp;array,&nbsp;in-place.<br>
&nbsp;<br>
Parameters<br>
----------<br>
axis&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Axis&nbsp;along&nbsp;which&nbsp;to&nbsp;sort.&nbsp;Default&nbsp;is&nbsp;-1,&nbsp;which&nbsp;means&nbsp;sort&nbsp;along&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;last&nbsp;axis.<br>
kind&nbsp;:&nbsp;{'quicksort',&nbsp;'mergesort',&nbsp;'heapsort'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Sorting&nbsp;algorithm.&nbsp;Default&nbsp;is&nbsp;'quicksort'.<br>
order&nbsp;:&nbsp;list,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;`a`&nbsp;is&nbsp;an&nbsp;array&nbsp;with&nbsp;fields&nbsp;defined,&nbsp;this&nbsp;argument&nbsp;specifies<br>
&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;fields&nbsp;to&nbsp;compare&nbsp;first,&nbsp;second,&nbsp;etc.&nbsp;&nbsp;Not&nbsp;all&nbsp;fields&nbsp;need&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;specified.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.sort&nbsp;:&nbsp;Return&nbsp;a&nbsp;sorted&nbsp;copy&nbsp;of&nbsp;an&nbsp;array.<br>
argsort&nbsp;:&nbsp;Indirect&nbsp;sort.<br>
lexsort&nbsp;:&nbsp;Indirect&nbsp;stable&nbsp;sort&nbsp;on&nbsp;multiple&nbsp;keys.<br>
searchsorted&nbsp;:&nbsp;Find&nbsp;elements&nbsp;in&nbsp;sorted&nbsp;array.<br>
&nbsp;<br>
Notes<br>
-----<br>
See&nbsp;``sort``&nbsp;for&nbsp;notes&nbsp;on&nbsp;the&nbsp;different&nbsp;sorting&nbsp;algorithms.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[1,4],&nbsp;[3,1]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-sort">sort</a>(axis=1)<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[1,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-sort">sort</a>(axis=0)<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[1,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;4]])<br>
&nbsp;<br>
Use&nbsp;the&nbsp;`order`&nbsp;keyword&nbsp;to&nbsp;specify&nbsp;a&nbsp;field&nbsp;to&nbsp;use&nbsp;when&nbsp;sorting&nbsp;a<br>
structured&nbsp;array:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([('a',&nbsp;2),&nbsp;('c',&nbsp;1)],&nbsp;dtype=[('x',&nbsp;'S1'),&nbsp;('y',&nbsp;int)])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-sort">sort</a>(order='y')<br>
&gt;&gt;&gt;&nbsp;a<br>
array([('c',&nbsp;1),&nbsp;('a',&nbsp;2)],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('x',&nbsp;'|S1'),&nbsp;('y',&nbsp;'&lt;i4')])</tt></dd></dl>

<dl><dt><a name="Particle-squeeze"><strong>squeeze</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-squeeze">squeeze</a>(axis=None)<br>
&nbsp;<br>
Remove&nbsp;single-dimensional&nbsp;entries&nbsp;from&nbsp;the&nbsp;shape&nbsp;of&nbsp;`a`.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.squeeze`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.squeeze&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-std"><strong>std</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-std">std</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None,&nbsp;ddof=0)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;standard&nbsp;deviation&nbsp;of&nbsp;the&nbsp;array&nbsp;elements&nbsp;along&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.std`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.std&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-sum"><strong>sum</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-sum">sum</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;array&nbsp;elements&nbsp;over&nbsp;the&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.sum`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.sum&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-swapaxes"><strong>swapaxes</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-swapaxes">swapaxes</a>(axis1,&nbsp;axis2)<br>
&nbsp;<br>
Return&nbsp;a&nbsp;view&nbsp;of&nbsp;the&nbsp;array&nbsp;with&nbsp;`axis1`&nbsp;and&nbsp;`axis2`&nbsp;interchanged.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.swapaxes`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.swapaxes&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-take"><strong>take</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-take">take</a>(indices,&nbsp;axis=None,&nbsp;out=None,&nbsp;mode='raise')<br>
&nbsp;<br>
Return&nbsp;an&nbsp;array&nbsp;formed&nbsp;from&nbsp;the&nbsp;elements&nbsp;of&nbsp;`a`&nbsp;at&nbsp;the&nbsp;given&nbsp;indices.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.take`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.take&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-tofile"><strong>tofile</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-tofile">tofile</a>(fid,&nbsp;sep="",&nbsp;format="%s")<br>
&nbsp;<br>
Write&nbsp;array&nbsp;to&nbsp;a&nbsp;file&nbsp;as&nbsp;text&nbsp;or&nbsp;binary&nbsp;(default).<br>
&nbsp;<br>
Data&nbsp;is&nbsp;always&nbsp;written&nbsp;in&nbsp;'C'&nbsp;order,&nbsp;independent&nbsp;of&nbsp;the&nbsp;order&nbsp;of&nbsp;`a`.<br>
The&nbsp;data&nbsp;produced&nbsp;by&nbsp;this&nbsp;method&nbsp;can&nbsp;be&nbsp;recovered&nbsp;using&nbsp;the&nbsp;function<br>
fromfile().<br>
&nbsp;<br>
Parameters<br>
----------<br>
fid&nbsp;:&nbsp;file&nbsp;or&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;open&nbsp;file&nbsp;object,&nbsp;or&nbsp;a&nbsp;string&nbsp;containing&nbsp;a&nbsp;filename.<br>
sep&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;Separator&nbsp;between&nbsp;array&nbsp;items&nbsp;for&nbsp;text&nbsp;output.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;""&nbsp;(empty),&nbsp;a&nbsp;binary&nbsp;file&nbsp;is&nbsp;written,&nbsp;equivalent&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;``file.write(a.<a href="#Particle-tostring">tostring</a>())``.<br>
format&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;Format&nbsp;string&nbsp;for&nbsp;text&nbsp;file&nbsp;output.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;entry&nbsp;in&nbsp;the&nbsp;array&nbsp;is&nbsp;formatted&nbsp;to&nbsp;text&nbsp;by&nbsp;first&nbsp;converting<br>
&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;to&nbsp;the&nbsp;closest&nbsp;Python&nbsp;type,&nbsp;and&nbsp;then&nbsp;using&nbsp;"format"&nbsp;%&nbsp;item.<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;function&nbsp;for&nbsp;quick&nbsp;storage&nbsp;of&nbsp;array&nbsp;data.<br>
Information&nbsp;on&nbsp;endianness&nbsp;and&nbsp;precision&nbsp;is&nbsp;lost,&nbsp;so&nbsp;this&nbsp;method&nbsp;is&nbsp;not&nbsp;a<br>
good&nbsp;choice&nbsp;for&nbsp;files&nbsp;intended&nbsp;to&nbsp;archive&nbsp;data&nbsp;or&nbsp;transport&nbsp;data&nbsp;between<br>
machines&nbsp;with&nbsp;different&nbsp;endianness.&nbsp;Some&nbsp;of&nbsp;these&nbsp;problems&nbsp;can&nbsp;be&nbsp;overcome<br>
by&nbsp;outputting&nbsp;the&nbsp;data&nbsp;as&nbsp;text&nbsp;files,&nbsp;at&nbsp;the&nbsp;expense&nbsp;of&nbsp;speed&nbsp;and&nbsp;file<br>
size.</tt></dd></dl>

<dl><dt><a name="Particle-tolist"><strong>tolist</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-tolist">tolist</a>()<br>
&nbsp;<br>
Return&nbsp;the&nbsp;array&nbsp;as&nbsp;a&nbsp;(possibly&nbsp;nested)&nbsp;list.<br>
&nbsp;<br>
Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;array&nbsp;data&nbsp;as&nbsp;a&nbsp;(nested)&nbsp;Python&nbsp;list.<br>
Data&nbsp;items&nbsp;are&nbsp;converted&nbsp;to&nbsp;the&nbsp;nearest&nbsp;compatible&nbsp;Python&nbsp;type.<br>
&nbsp;<br>
Parameters<br>
----------<br>
none<br>
&nbsp;<br>
Returns<br>
-------<br>
y&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;possibly&nbsp;nested&nbsp;list&nbsp;of&nbsp;array&nbsp;elements.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;array&nbsp;may&nbsp;be&nbsp;recreated,&nbsp;``a&nbsp;=&nbsp;np.array(a.<a href="#Particle-tolist">tolist</a>())``.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([1,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-tolist">tolist</a>()<br>
[1,&nbsp;2]<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[1,&nbsp;2],&nbsp;[3,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;list(a)<br>
[array([1,&nbsp;2]),&nbsp;array([3,&nbsp;4])]<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-tolist">tolist</a>()<br>
[[1,&nbsp;2],&nbsp;[3,&nbsp;4]]</tt></dd></dl>

<dl><dt><a name="Particle-tostring"><strong>tostring</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-tostring">tostring</a>(order='C')<br>
&nbsp;<br>
Construct&nbsp;a&nbsp;Python&nbsp;string&nbsp;containing&nbsp;the&nbsp;raw&nbsp;data&nbsp;bytes&nbsp;in&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Constructs&nbsp;a&nbsp;Python&nbsp;string&nbsp;showing&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;raw&nbsp;contents&nbsp;of<br>
data&nbsp;memory.&nbsp;The&nbsp;string&nbsp;can&nbsp;be&nbsp;produced&nbsp;in&nbsp;either&nbsp;'C'&nbsp;or&nbsp;'Fortran',<br>
or&nbsp;'Any'&nbsp;order&nbsp;(the&nbsp;default&nbsp;is&nbsp;'C'-order).&nbsp;'Any'&nbsp;order&nbsp;means&nbsp;C-order<br>
unless&nbsp;the&nbsp;F_CONTIGUOUS&nbsp;flag&nbsp;in&nbsp;the&nbsp;array&nbsp;is&nbsp;set,&nbsp;in&nbsp;which&nbsp;case&nbsp;it<br>
means&nbsp;'Fortran'&nbsp;order.<br>
&nbsp;<br>
Parameters<br>
----------<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;None},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Order&nbsp;of&nbsp;the&nbsp;data&nbsp;for&nbsp;multidimensional&nbsp;arrays:<br>
&nbsp;&nbsp;&nbsp;&nbsp;C,&nbsp;Fortran,&nbsp;or&nbsp;the&nbsp;same&nbsp;as&nbsp;for&nbsp;the&nbsp;original&nbsp;array.<br>
&nbsp;<br>
Returns<br>
-------<br>
s&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;Python&nbsp;string&nbsp;exhibiting&nbsp;a&nbsp;copy&nbsp;of&nbsp;`a`'s&nbsp;raw&nbsp;data.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([[0,&nbsp;1],&nbsp;[2,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-tostring">tostring</a>()<br>
'\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-tostring">tostring</a>('C')&nbsp;==&nbsp;x.<a href="#Particle-tostring">tostring</a>()<br>
True<br>
&gt;&gt;&gt;&nbsp;x.<a href="#Particle-tostring">tostring</a>('F')<br>
'\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00'</tt></dd></dl>

<dl><dt><a name="Particle-trace"><strong>trace</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-trace">trace</a>(offset=0,&nbsp;axis1=0,&nbsp;axis2=1,&nbsp;dtype=None,&nbsp;out=None)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;sum&nbsp;along&nbsp;diagonals&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.trace`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.trace&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-transpose"><strong>transpose</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-transpose">transpose</a>(*axes)<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;view&nbsp;of&nbsp;the&nbsp;array&nbsp;with&nbsp;axes&nbsp;transposed.<br>
&nbsp;<br>
For&nbsp;a&nbsp;1-D&nbsp;array,&nbsp;this&nbsp;has&nbsp;no&nbsp;effect.&nbsp;(To&nbsp;change&nbsp;between&nbsp;column&nbsp;and<br>
row&nbsp;vectors,&nbsp;first&nbsp;cast&nbsp;the&nbsp;1-D&nbsp;array&nbsp;into&nbsp;a&nbsp;matrix&nbsp;object.)<br>
For&nbsp;a&nbsp;2-D&nbsp;array,&nbsp;this&nbsp;is&nbsp;the&nbsp;usual&nbsp;matrix&nbsp;transpose.<br>
For&nbsp;an&nbsp;n-D&nbsp;array,&nbsp;if&nbsp;axes&nbsp;are&nbsp;given,&nbsp;their&nbsp;order&nbsp;indicates&nbsp;how&nbsp;the<br>
axes&nbsp;are&nbsp;permuted&nbsp;(see&nbsp;Examples).&nbsp;If&nbsp;axes&nbsp;are&nbsp;not&nbsp;provided&nbsp;and<br>
``a.shape&nbsp;=&nbsp;(i[0],&nbsp;i[1],&nbsp;...&nbsp;i[n-2],&nbsp;i[n-1])``,&nbsp;then<br>
``a.<a href="#Particle-transpose">transpose</a>().shape&nbsp;=&nbsp;(i[n-1],&nbsp;i[n-2],&nbsp;...&nbsp;i[1],&nbsp;i[0])``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
axes&nbsp;:&nbsp;None,&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;or&nbsp;`n`&nbsp;ints<br>
&nbsp;<br>
&nbsp;*&nbsp;None&nbsp;or&nbsp;no&nbsp;argument:&nbsp;reverses&nbsp;the&nbsp;order&nbsp;of&nbsp;the&nbsp;axes.<br>
&nbsp;<br>
&nbsp;*&nbsp;tuple&nbsp;of&nbsp;ints:&nbsp;`i`&nbsp;in&nbsp;the&nbsp;`j`-th&nbsp;place&nbsp;in&nbsp;the&nbsp;tuple&nbsp;means&nbsp;`a`'s<br>
&nbsp;&nbsp;&nbsp;`i`-th&nbsp;axis&nbsp;becomes&nbsp;`a.<a href="#Particle-transpose">transpose</a>()`'s&nbsp;`j`-th&nbsp;axis.<br>
&nbsp;<br>
&nbsp;*&nbsp;`n`&nbsp;ints:&nbsp;same&nbsp;as&nbsp;an&nbsp;n-tuple&nbsp;of&nbsp;the&nbsp;same&nbsp;ints&nbsp;(this&nbsp;form&nbsp;is<br>
&nbsp;&nbsp;&nbsp;intended&nbsp;simply&nbsp;as&nbsp;a&nbsp;"convenience"&nbsp;alternative&nbsp;to&nbsp;the&nbsp;tuple&nbsp;form)<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;<a href="numpy.html#ndarray">ndarray</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;View&nbsp;of&nbsp;`a`,&nbsp;with&nbsp;axes&nbsp;suitably&nbsp;permuted.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
<a href="numpy.html#ndarray">ndarray</a>.T&nbsp;:&nbsp;Array&nbsp;property&nbsp;returning&nbsp;the&nbsp;array&nbsp;transposed.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[1,&nbsp;2],&nbsp;[3,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;a<br>
array([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-transpose">transpose</a>()<br>
array([[1,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-transpose">transpose</a>((1,&nbsp;0))<br>
array([[1,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;a.<a href="#Particle-transpose">transpose</a>(1,&nbsp;0)<br>
array([[1,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;4]])</tt></dd></dl>

<dl><dt><a name="Particle-var"><strong>var</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-var">var</a>(axis=None,&nbsp;dtype=None,&nbsp;out=None,&nbsp;ddof=0)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;variance&nbsp;of&nbsp;the&nbsp;array&nbsp;elements,&nbsp;along&nbsp;given&nbsp;axis.<br>
&nbsp;<br>
Refer&nbsp;to&nbsp;`numpy.var`&nbsp;for&nbsp;full&nbsp;documentation.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.var&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd></dl>

<dl><dt><a name="Particle-view"><strong>view</strong></a>(...)</dt><dd><tt>a.<a href="#Particle-view">view</a>(dtype=None,&nbsp;type=None)<br>
&nbsp;<br>
New&nbsp;view&nbsp;of&nbsp;array&nbsp;with&nbsp;the&nbsp;same&nbsp;data.<br>
&nbsp;<br>
Parameters<br>
----------<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data-type&nbsp;descriptor&nbsp;of&nbsp;the&nbsp;returned&nbsp;view,&nbsp;e.g.,&nbsp;float32&nbsp;or&nbsp;int16.<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default,&nbsp;None,&nbsp;results&nbsp;in&nbsp;the&nbsp;view&nbsp;having&nbsp;the&nbsp;same&nbsp;data-type<br>
&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;`a`.<br>
type&nbsp;:&nbsp;Python&nbsp;type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Type&nbsp;of&nbsp;the&nbsp;returned&nbsp;view,&nbsp;e.g.,&nbsp;<a href="numpy.html#ndarray">ndarray</a>&nbsp;or&nbsp;matrix.&nbsp;&nbsp;Again,&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;None&nbsp;results&nbsp;in&nbsp;type&nbsp;preservation.<br>
&nbsp;<br>
Notes<br>
-----<br>
``a.<a href="#Particle-view">view</a>()``&nbsp;is&nbsp;used&nbsp;two&nbsp;different&nbsp;ways:<br>
&nbsp;<br>
``a.<a href="#Particle-view">view</a>(some_dtype)``&nbsp;or&nbsp;``a.<a href="#Particle-view">view</a>(dtype=some_dtype)``&nbsp;constructs&nbsp;a&nbsp;view<br>
of&nbsp;the&nbsp;array's&nbsp;memory&nbsp;with&nbsp;a&nbsp;different&nbsp;data-type.&nbsp;&nbsp;This&nbsp;can&nbsp;cause&nbsp;a<br>
reinterpretation&nbsp;of&nbsp;the&nbsp;bytes&nbsp;of&nbsp;memory.<br>
&nbsp;<br>
``a.<a href="#Particle-view">view</a>(ndarray_subclass)``&nbsp;or&nbsp;``a.<a href="#Particle-view">view</a>(type=ndarray_subclass)``&nbsp;just<br>
returns&nbsp;an&nbsp;instance&nbsp;of&nbsp;`ndarray_subclass`&nbsp;that&nbsp;looks&nbsp;at&nbsp;the&nbsp;same&nbsp;array<br>
(same&nbsp;shape,&nbsp;dtype,&nbsp;etc.)&nbsp;&nbsp;This&nbsp;does&nbsp;not&nbsp;cause&nbsp;a&nbsp;reinterpretation&nbsp;of&nbsp;the<br>
memory.<br>
&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([(1,&nbsp;2)],&nbsp;dtype=[('a',&nbsp;np.int8),&nbsp;('b',&nbsp;np.int8)])<br>
&nbsp;<br>
Viewing&nbsp;array&nbsp;data&nbsp;using&nbsp;a&nbsp;different&nbsp;type&nbsp;and&nbsp;dtype:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;x.<a href="#Particle-view">view</a>(dtype=np.int16,&nbsp;type=np.matrix)<br>
&gt;&gt;&gt;&nbsp;y<br>
matrix([[513]],&nbsp;dtype=int16)<br>
&gt;&gt;&gt;&nbsp;print&nbsp;type(y)<br>
&lt;class&nbsp;'numpy.matrixlib.defmatrix.matrix'&gt;<br>
&nbsp;<br>
Creating&nbsp;a&nbsp;view&nbsp;on&nbsp;a&nbsp;structured&nbsp;array&nbsp;so&nbsp;it&nbsp;can&nbsp;be&nbsp;used&nbsp;in&nbsp;calculations<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([(1,&nbsp;2),(3,4)],&nbsp;dtype=[('a',&nbsp;np.int8),&nbsp;('b',&nbsp;np.int8)])<br>
&gt;&gt;&gt;&nbsp;xv&nbsp;=&nbsp;x.<a href="#Particle-view">view</a>(dtype=np.int8).<a href="#Particle-reshape">reshape</a>(-1,2)<br>
&gt;&gt;&gt;&nbsp;xv<br>
array([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]],&nbsp;dtype=int8)<br>
&gt;&gt;&gt;&nbsp;xv.<a href="#Particle-mean">mean</a>(0)<br>
array([&nbsp;2.,&nbsp;&nbsp;3.])<br>
&nbsp;<br>
Making&nbsp;changes&nbsp;to&nbsp;the&nbsp;view&nbsp;changes&nbsp;the&nbsp;underlying&nbsp;array<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;xv[0,1]&nbsp;=&nbsp;20<br>
&gt;&gt;&gt;&nbsp;print&nbsp;x<br>
[(1,&nbsp;20)&nbsp;(3,&nbsp;4)]<br>
&nbsp;<br>
Using&nbsp;a&nbsp;view&nbsp;to&nbsp;convert&nbsp;an&nbsp;array&nbsp;to&nbsp;a&nbsp;record&nbsp;array:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;z&nbsp;=&nbsp;x.<a href="#Particle-view">view</a>(np.recarray)<br>
&gt;&gt;&gt;&nbsp;z.a<br>
array([1],&nbsp;dtype=int8)<br>
&nbsp;<br>
Views&nbsp;share&nbsp;data:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x[0]&nbsp;=&nbsp;(9,&nbsp;10)<br>
&gt;&gt;&gt;&nbsp;z[0]<br>
(9,&nbsp;10)</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="numpy.html#ndarray">numpy.ndarray</a>:<br>
<dl><dt><strong>T</strong></dt>
<dd><tt>Same&nbsp;as&nbsp;transpose(),&nbsp;except&nbsp;that&nbsp;self&nbsp;is&nbsp;returned&nbsp;if<br>
self.<strong>ndim</strong>&nbsp;&lt;&nbsp;2.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([[1.,2.],[3.,4.]])<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[&nbsp;1.,&nbsp;&nbsp;2.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;3.,&nbsp;&nbsp;4.]])<br>
&gt;&gt;&gt;&nbsp;x.T<br>
array([[&nbsp;1.,&nbsp;&nbsp;3.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;2.,&nbsp;&nbsp;4.]])<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1.,2.,3.,4.])<br>
&gt;&gt;&gt;&nbsp;x<br>
array([&nbsp;1.,&nbsp;&nbsp;2.,&nbsp;&nbsp;3.,&nbsp;&nbsp;4.])<br>
&gt;&gt;&gt;&nbsp;x.T<br>
array([&nbsp;1.,&nbsp;&nbsp;2.,&nbsp;&nbsp;3.,&nbsp;&nbsp;4.])</tt></dd>
</dl>
<dl><dt><strong>__array_interface__</strong></dt>
<dd><tt>Array&nbsp;protocol:&nbsp;Python&nbsp;side.</tt></dd>
</dl>
<dl><dt><strong>__array_priority__</strong></dt>
<dd><tt>Array&nbsp;priority.</tt></dd>
</dl>
<dl><dt><strong>__array_struct__</strong></dt>
<dd><tt>Array&nbsp;protocol:&nbsp;C-struct&nbsp;side.</tt></dd>
</dl>
<dl><dt><strong>base</strong></dt>
<dd><tt>Base&nbsp;object&nbsp;if&nbsp;memory&nbsp;is&nbsp;from&nbsp;some&nbsp;other&nbsp;object.<br>
&nbsp;<br>
Examples<br>
--------<br>
The&nbsp;base&nbsp;of&nbsp;an&nbsp;array&nbsp;that&nbsp;owns&nbsp;its&nbsp;memory&nbsp;is&nbsp;None:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,2,3,4])<br>
&gt;&gt;&gt;&nbsp;x.base&nbsp;is&nbsp;None<br>
True<br>
&nbsp;<br>
Slicing&nbsp;creates&nbsp;a&nbsp;view,&nbsp;whose&nbsp;memory&nbsp;is&nbsp;shared&nbsp;with&nbsp;x:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;x[2:]<br>
&gt;&gt;&gt;&nbsp;y.base&nbsp;is&nbsp;x<br>
True</tt></dd>
</dl>
<dl><dt><strong>ctypes</strong></dt>
<dd><tt>An&nbsp;object&nbsp;to&nbsp;simplify&nbsp;the&nbsp;interaction&nbsp;of&nbsp;the&nbsp;array&nbsp;with&nbsp;the&nbsp;ctypes<br>
module.<br>
&nbsp;<br>
This&nbsp;attribute&nbsp;creates&nbsp;an&nbsp;object&nbsp;that&nbsp;makes&nbsp;it&nbsp;easier&nbsp;to&nbsp;use&nbsp;arrays<br>
when&nbsp;calling&nbsp;shared&nbsp;libraries&nbsp;with&nbsp;the&nbsp;ctypes&nbsp;module.&nbsp;The&nbsp;returned<br>
object&nbsp;has,&nbsp;among&nbsp;others,&nbsp;data,&nbsp;shape,&nbsp;and&nbsp;strides&nbsp;attributes&nbsp;(see<br>
Notes&nbsp;below)&nbsp;which&nbsp;themselves&nbsp;return&nbsp;ctypes&nbsp;objects&nbsp;that&nbsp;can&nbsp;be&nbsp;used<br>
as&nbsp;arguments&nbsp;to&nbsp;a&nbsp;shared&nbsp;library.<br>
&nbsp;<br>
Parameters<br>
----------<br>
None<br>
&nbsp;<br>
Returns<br>
-------<br>
c&nbsp;:&nbsp;Python&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;Possessing&nbsp;attributes&nbsp;data,&nbsp;shape,&nbsp;strides,&nbsp;etc.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.ctypeslib<br>
&nbsp;<br>
Notes<br>
-----<br>
Below&nbsp;are&nbsp;the&nbsp;public&nbsp;attributes&nbsp;of&nbsp;this&nbsp;object&nbsp;which&nbsp;were&nbsp;documented<br>
in&nbsp;"Guide&nbsp;to&nbsp;NumPy"&nbsp;(we&nbsp;have&nbsp;omitted&nbsp;undocumented&nbsp;public&nbsp;attributes,<br>
as&nbsp;well&nbsp;as&nbsp;documented&nbsp;private&nbsp;attributes):<br>
&nbsp;<br>
*&nbsp;data:&nbsp;A&nbsp;pointer&nbsp;to&nbsp;the&nbsp;memory&nbsp;area&nbsp;of&nbsp;the&nbsp;array&nbsp;as&nbsp;a&nbsp;Python&nbsp;integer.<br>
&nbsp;&nbsp;This&nbsp;memory&nbsp;area&nbsp;may&nbsp;contain&nbsp;data&nbsp;that&nbsp;is&nbsp;not&nbsp;aligned,&nbsp;or&nbsp;not&nbsp;in&nbsp;correct<br>
&nbsp;&nbsp;byte-order.&nbsp;The&nbsp;memory&nbsp;area&nbsp;may&nbsp;not&nbsp;even&nbsp;be&nbsp;writeable.&nbsp;The&nbsp;array<br>
&nbsp;&nbsp;flags&nbsp;and&nbsp;data-type&nbsp;of&nbsp;this&nbsp;array&nbsp;should&nbsp;be&nbsp;respected&nbsp;when&nbsp;passing&nbsp;this<br>
&nbsp;&nbsp;attribute&nbsp;to&nbsp;arbitrary&nbsp;C-code&nbsp;to&nbsp;avoid&nbsp;trouble&nbsp;that&nbsp;can&nbsp;include&nbsp;Python<br>
&nbsp;&nbsp;crashing.&nbsp;User&nbsp;Beware!&nbsp;The&nbsp;value&nbsp;of&nbsp;this&nbsp;attribute&nbsp;is&nbsp;exactly&nbsp;the&nbsp;same<br>
&nbsp;&nbsp;as&nbsp;self.<strong>_array_interface_</strong>['data'][0].<br>
&nbsp;<br>
*&nbsp;shape&nbsp;(c_intp*self.<strong>ndim</strong>):&nbsp;A&nbsp;ctypes&nbsp;array&nbsp;of&nbsp;length&nbsp;self.<strong>ndim</strong>&nbsp;where<br>
&nbsp;&nbsp;the&nbsp;basetype&nbsp;is&nbsp;the&nbsp;C-integer&nbsp;corresponding&nbsp;to&nbsp;dtype('p')&nbsp;on&nbsp;this<br>
&nbsp;&nbsp;platform.&nbsp;This&nbsp;base-type&nbsp;could&nbsp;be&nbsp;c_int,&nbsp;c_long,&nbsp;or&nbsp;c_longlong<br>
&nbsp;&nbsp;depending&nbsp;on&nbsp;the&nbsp;platform.&nbsp;The&nbsp;c_intp&nbsp;type&nbsp;is&nbsp;defined&nbsp;accordingly&nbsp;in<br>
&nbsp;&nbsp;numpy.ctypeslib.&nbsp;The&nbsp;ctypes&nbsp;array&nbsp;contains&nbsp;the&nbsp;shape&nbsp;of&nbsp;the&nbsp;underlying<br>
&nbsp;&nbsp;array.<br>
&nbsp;<br>
*&nbsp;strides&nbsp;(c_intp*self.<strong>ndim</strong>):&nbsp;A&nbsp;ctypes&nbsp;array&nbsp;of&nbsp;length&nbsp;self.<strong>ndim</strong>&nbsp;where<br>
&nbsp;&nbsp;the&nbsp;basetype&nbsp;is&nbsp;the&nbsp;same&nbsp;as&nbsp;for&nbsp;the&nbsp;shape&nbsp;attribute.&nbsp;This&nbsp;ctypes&nbsp;array<br>
&nbsp;&nbsp;contains&nbsp;the&nbsp;strides&nbsp;information&nbsp;from&nbsp;the&nbsp;underlying&nbsp;array.&nbsp;This&nbsp;strides<br>
&nbsp;&nbsp;information&nbsp;is&nbsp;important&nbsp;for&nbsp;showing&nbsp;how&nbsp;many&nbsp;bytes&nbsp;must&nbsp;be&nbsp;jumped&nbsp;to<br>
&nbsp;&nbsp;get&nbsp;to&nbsp;the&nbsp;next&nbsp;element&nbsp;in&nbsp;the&nbsp;array.<br>
&nbsp;<br>
*&nbsp;data_as(obj):&nbsp;Return&nbsp;the&nbsp;data&nbsp;pointer&nbsp;cast&nbsp;to&nbsp;a&nbsp;particular&nbsp;c-types&nbsp;object.<br>
&nbsp;&nbsp;For&nbsp;example,&nbsp;calling&nbsp;self.<strong>_as_parameter_</strong>&nbsp;is&nbsp;equivalent&nbsp;to<br>
&nbsp;&nbsp;data_as(ctypes.c_void_p).&nbsp;Perhaps&nbsp;you&nbsp;want&nbsp;to&nbsp;use&nbsp;the&nbsp;data&nbsp;as&nbsp;a<br>
&nbsp;&nbsp;pointer&nbsp;to&nbsp;a&nbsp;ctypes&nbsp;array&nbsp;of&nbsp;floating-point&nbsp;data:<br>
&nbsp;&nbsp;data_as(ctypes.POINTER(ctypes.c_double)).<br>
&nbsp;<br>
*&nbsp;shape_as(obj):&nbsp;Return&nbsp;the&nbsp;shape&nbsp;tuple&nbsp;as&nbsp;an&nbsp;array&nbsp;of&nbsp;some&nbsp;other&nbsp;c-types<br>
&nbsp;&nbsp;type.&nbsp;For&nbsp;example:&nbsp;shape_as(ctypes.c_short).<br>
&nbsp;<br>
*&nbsp;strides_as(obj):&nbsp;Return&nbsp;the&nbsp;strides&nbsp;tuple&nbsp;as&nbsp;an&nbsp;array&nbsp;of&nbsp;some&nbsp;other<br>
&nbsp;&nbsp;c-types&nbsp;type.&nbsp;For&nbsp;example:&nbsp;strides_as(ctypes.c_longlong).<br>
&nbsp;<br>
Be&nbsp;careful&nbsp;using&nbsp;the&nbsp;ctypes&nbsp;attribute&nbsp;-&nbsp;especially&nbsp;on&nbsp;temporary<br>
arrays&nbsp;or&nbsp;arrays&nbsp;constructed&nbsp;on&nbsp;the&nbsp;fly.&nbsp;For&nbsp;example,&nbsp;calling<br>
``(a+b).ctypes.data_as(ctypes.c_void_p)``&nbsp;returns&nbsp;a&nbsp;pointer&nbsp;to&nbsp;memory<br>
that&nbsp;is&nbsp;invalid&nbsp;because&nbsp;the&nbsp;array&nbsp;created&nbsp;as&nbsp;(a+b)&nbsp;is&nbsp;deallocated<br>
before&nbsp;the&nbsp;next&nbsp;Python&nbsp;statement.&nbsp;You&nbsp;can&nbsp;avoid&nbsp;this&nbsp;problem&nbsp;using<br>
either&nbsp;``c=a+b``&nbsp;or&nbsp;``ct=(a+b).ctypes``.&nbsp;In&nbsp;the&nbsp;latter&nbsp;case,&nbsp;ct&nbsp;will<br>
hold&nbsp;a&nbsp;reference&nbsp;to&nbsp;the&nbsp;array&nbsp;until&nbsp;ct&nbsp;is&nbsp;deleted&nbsp;or&nbsp;re-assigned.<br>
&nbsp;<br>
If&nbsp;the&nbsp;ctypes&nbsp;module&nbsp;is&nbsp;not&nbsp;available,&nbsp;then&nbsp;the&nbsp;ctypes&nbsp;attribute<br>
of&nbsp;array&nbsp;objects&nbsp;still&nbsp;returns&nbsp;something&nbsp;useful,&nbsp;but&nbsp;ctypes&nbsp;objects<br>
are&nbsp;not&nbsp;returned&nbsp;and&nbsp;errors&nbsp;may&nbsp;be&nbsp;raised&nbsp;instead.&nbsp;In&nbsp;particular,<br>
the&nbsp;object&nbsp;will&nbsp;still&nbsp;have&nbsp;the&nbsp;as&nbsp;parameter&nbsp;attribute&nbsp;which&nbsp;will<br>
return&nbsp;an&nbsp;integer&nbsp;equal&nbsp;to&nbsp;the&nbsp;data&nbsp;attribute.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;import&nbsp;ctypes<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[0,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.ctypes.data<br>
30439712<br>
&gt;&gt;&gt;&nbsp;x.ctypes.data_as(ctypes.POINTER(ctypes.c_long))<br>
&lt;ctypes.LP_c_long&nbsp;object&nbsp;at&nbsp;0x01F01300&gt;<br>
&gt;&gt;&gt;&nbsp;x.ctypes.data_as(ctypes.POINTER(ctypes.c_long)).contents<br>
c_long(0)<br>
&gt;&gt;&gt;&nbsp;x.ctypes.data_as(ctypes.POINTER(ctypes.c_longlong)).contents<br>
c_longlong(4294967296L)<br>
&gt;&gt;&gt;&nbsp;x.ctypes.shape<br>
&lt;numpy.core._internal.c_long_Array_2&nbsp;object&nbsp;at&nbsp;0x01FFD580&gt;<br>
&gt;&gt;&gt;&nbsp;x.ctypes.shape_as(ctypes.c_long)<br>
&lt;numpy.core._internal.c_long_Array_2&nbsp;object&nbsp;at&nbsp;0x01FCE620&gt;<br>
&gt;&gt;&gt;&nbsp;x.ctypes.strides<br>
&lt;numpy.core._internal.c_long_Array_2&nbsp;object&nbsp;at&nbsp;0x01FCE620&gt;<br>
&gt;&gt;&gt;&nbsp;x.ctypes.strides_as(ctypes.c_longlong)<br>
&lt;numpy.core._internal.c_longlong_Array_2&nbsp;object&nbsp;at&nbsp;0x01F01300&gt;</tt></dd>
</dl>
<dl><dt><strong>data</strong></dt>
<dd><tt>Python&nbsp;buffer&nbsp;object&nbsp;pointing&nbsp;to&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;array's&nbsp;data.</tt></dd>
</dl>
<dl><dt><strong>dtype</strong></dt>
<dd><tt>Data-type&nbsp;of&nbsp;the&nbsp;array's&nbsp;elements.<br>
&nbsp;<br>
Parameters<br>
----------<br>
None<br>
&nbsp;<br>
Returns<br>
-------<br>
d&nbsp;:&nbsp;numpy&nbsp;dtype&nbsp;object<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.dtype<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[0,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.dtype<br>
dtype('int32')<br>
&gt;&gt;&gt;&nbsp;type(x.dtype)<br>
&lt;type&nbsp;'numpy.dtype'&gt;</tt></dd>
</dl>
<dl><dt><strong>flags</strong></dt>
<dd><tt>Information&nbsp;about&nbsp;the&nbsp;memory&nbsp;layout&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Attributes<br>
----------<br>
C_CONTIGUOUS&nbsp;(C)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;is&nbsp;in&nbsp;a&nbsp;single,&nbsp;C-style&nbsp;contiguous&nbsp;segment.<br>
F_CONTIGUOUS&nbsp;(F)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;is&nbsp;in&nbsp;a&nbsp;single,&nbsp;Fortran-style&nbsp;contiguous&nbsp;segment.<br>
OWNDATA&nbsp;(O)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;owns&nbsp;the&nbsp;memory&nbsp;it&nbsp;uses&nbsp;or&nbsp;borrows&nbsp;it&nbsp;from&nbsp;another&nbsp;object.<br>
WRITEABLE&nbsp;(W)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;area&nbsp;can&nbsp;be&nbsp;written&nbsp;to.&nbsp;&nbsp;Setting&nbsp;this&nbsp;to&nbsp;False&nbsp;locks<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;data,&nbsp;making&nbsp;it&nbsp;read-only.&nbsp;&nbsp;A&nbsp;view&nbsp;(slice,&nbsp;etc.)&nbsp;inherits&nbsp;WRITEABLE<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;its&nbsp;base&nbsp;array&nbsp;at&nbsp;creation&nbsp;time,&nbsp;but&nbsp;a&nbsp;view&nbsp;of&nbsp;a&nbsp;writeable<br>
&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;may&nbsp;be&nbsp;subsequently&nbsp;locked&nbsp;while&nbsp;the&nbsp;base&nbsp;array&nbsp;remains&nbsp;writeable.<br>
&nbsp;&nbsp;&nbsp;&nbsp;(The&nbsp;opposite&nbsp;is&nbsp;not&nbsp;true,&nbsp;in&nbsp;that&nbsp;a&nbsp;view&nbsp;of&nbsp;a&nbsp;locked&nbsp;array&nbsp;may&nbsp;not<br>
&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;made&nbsp;writeable.&nbsp;&nbsp;However,&nbsp;currently,&nbsp;locking&nbsp;a&nbsp;base&nbsp;object&nbsp;does&nbsp;not<br>
&nbsp;&nbsp;&nbsp;&nbsp;lock&nbsp;any&nbsp;views&nbsp;that&nbsp;already&nbsp;reference&nbsp;it,&nbsp;so&nbsp;under&nbsp;that&nbsp;circumstance&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;possible&nbsp;to&nbsp;alter&nbsp;the&nbsp;contents&nbsp;of&nbsp;a&nbsp;locked&nbsp;array&nbsp;via&nbsp;a&nbsp;previously<br>
&nbsp;&nbsp;&nbsp;&nbsp;created&nbsp;writeable&nbsp;view&nbsp;onto&nbsp;it.)&nbsp;&nbsp;Attempting&nbsp;to&nbsp;change&nbsp;a&nbsp;non-writeable<br>
&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;raises&nbsp;a&nbsp;RuntimeError&nbsp;exception.<br>
ALIGNED&nbsp;(A)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;and&nbsp;strides&nbsp;are&nbsp;aligned&nbsp;appropriately&nbsp;for&nbsp;the&nbsp;hardware.<br>
UPDATEIFCOPY&nbsp;(U)<br>
&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;array&nbsp;is&nbsp;a&nbsp;copy&nbsp;of&nbsp;some&nbsp;other&nbsp;array.&nbsp;When&nbsp;this&nbsp;array&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;deallocated,&nbsp;the&nbsp;base&nbsp;array&nbsp;will&nbsp;be&nbsp;updated&nbsp;with&nbsp;the&nbsp;contents&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;array.<br>
&nbsp;<br>
FNC<br>
&nbsp;&nbsp;&nbsp;&nbsp;F_CONTIGUOUS&nbsp;and&nbsp;not&nbsp;C_CONTIGUOUS.<br>
FORC<br>
&nbsp;&nbsp;&nbsp;&nbsp;F_CONTIGUOUS&nbsp;or&nbsp;C_CONTIGUOUS&nbsp;(one-segment&nbsp;test).<br>
BEHAVED&nbsp;(B)<br>
&nbsp;&nbsp;&nbsp;&nbsp;ALIGNED&nbsp;and&nbsp;WRITEABLE.<br>
CARRAY&nbsp;(CA)<br>
&nbsp;&nbsp;&nbsp;&nbsp;BEHAVED&nbsp;and&nbsp;C_CONTIGUOUS.<br>
FARRAY&nbsp;(FA)<br>
&nbsp;&nbsp;&nbsp;&nbsp;BEHAVED&nbsp;and&nbsp;F_CONTIGUOUS&nbsp;and&nbsp;not&nbsp;C_CONTIGUOUS.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;`flags`&nbsp;object&nbsp;can&nbsp;be&nbsp;accessed&nbsp;dictionary-like&nbsp;(as&nbsp;in&nbsp;``a.flags['WRITEABLE']``),<br>
or&nbsp;by&nbsp;using&nbsp;lowercased&nbsp;attribute&nbsp;names&nbsp;(as&nbsp;in&nbsp;``a.flags.writeable``).&nbsp;Short&nbsp;flag<br>
names&nbsp;are&nbsp;only&nbsp;supported&nbsp;in&nbsp;dictionary&nbsp;access.<br>
&nbsp;<br>
Only&nbsp;the&nbsp;UPDATEIFCOPY,&nbsp;WRITEABLE,&nbsp;and&nbsp;ALIGNED&nbsp;flags&nbsp;can&nbsp;be&nbsp;changed&nbsp;by<br>
the&nbsp;user,&nbsp;via&nbsp;direct&nbsp;assignment&nbsp;to&nbsp;the&nbsp;attribute&nbsp;or&nbsp;dictionary&nbsp;entry,<br>
or&nbsp;by&nbsp;calling&nbsp;`ndarray.setflags`.<br>
&nbsp;<br>
The&nbsp;array&nbsp;flags&nbsp;cannot&nbsp;be&nbsp;set&nbsp;arbitrarily:<br>
&nbsp;<br>
-&nbsp;UPDATEIFCOPY&nbsp;can&nbsp;only&nbsp;be&nbsp;set&nbsp;``False``.<br>
-&nbsp;ALIGNED&nbsp;can&nbsp;only&nbsp;be&nbsp;set&nbsp;``True``&nbsp;if&nbsp;the&nbsp;data&nbsp;is&nbsp;truly&nbsp;aligned.<br>
-&nbsp;WRITEABLE&nbsp;can&nbsp;only&nbsp;be&nbsp;set&nbsp;``True``&nbsp;if&nbsp;the&nbsp;array&nbsp;owns&nbsp;its&nbsp;own&nbsp;memory<br>
&nbsp;&nbsp;or&nbsp;the&nbsp;ultimate&nbsp;owner&nbsp;of&nbsp;the&nbsp;memory&nbsp;exposes&nbsp;a&nbsp;writeable&nbsp;buffer<br>
&nbsp;&nbsp;interface&nbsp;or&nbsp;is&nbsp;a&nbsp;string.</tt></dd>
</dl>
<dl><dt><strong>flat</strong></dt>
<dd><tt>A&nbsp;1-D&nbsp;iterator&nbsp;over&nbsp;the&nbsp;array.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;`numpy.flatiter`&nbsp;instance,&nbsp;which&nbsp;acts&nbsp;similarly&nbsp;to,&nbsp;but&nbsp;is&nbsp;not<br>
a&nbsp;subclass&nbsp;of,&nbsp;Python's&nbsp;built-in&nbsp;iterator&nbsp;object.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
flatten&nbsp;:&nbsp;Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;array&nbsp;collapsed&nbsp;into&nbsp;one&nbsp;dimension.<br>
&nbsp;<br>
flatiter<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.arange(1,&nbsp;7).reshape(2,&nbsp;3)<br>
&gt;&gt;&gt;&nbsp;x<br>
array([[1,&nbsp;2,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4,&nbsp;5,&nbsp;6]])<br>
&gt;&gt;&gt;&nbsp;x.flat[3]<br>
4<br>
&gt;&gt;&gt;&nbsp;x.T<br>
array([[1,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;5],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;6]])<br>
&gt;&gt;&gt;&nbsp;x.T.flat[3]<br>
5<br>
&gt;&gt;&gt;&nbsp;type(x.flat)<br>
&lt;type&nbsp;'numpy.flatiter'&gt;<br>
&nbsp;<br>
An&nbsp;assignment&nbsp;example:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x.flat&nbsp;=&nbsp;3;&nbsp;x<br>
array([[3,&nbsp;3,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;3,&nbsp;3]])<br>
&gt;&gt;&gt;&nbsp;x.flat[[1,4]]&nbsp;=&nbsp;1;&nbsp;x<br>
array([[3,&nbsp;1,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;1,&nbsp;3]])</tt></dd>
</dl>
<dl><dt><strong>imag</strong></dt>
<dd><tt>The&nbsp;imaginary&nbsp;part&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.sqrt([1+0j,&nbsp;0+1j])<br>
&gt;&gt;&gt;&nbsp;x.imag<br>
array([&nbsp;0.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.70710678])<br>
&gt;&gt;&gt;&nbsp;x.imag.dtype<br>
dtype('float64')</tt></dd>
</dl>
<dl><dt><strong>itemsize</strong></dt>
<dd><tt>Length&nbsp;of&nbsp;one&nbsp;array&nbsp;element&nbsp;in&nbsp;bytes.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,2,3],&nbsp;dtype=np.float64)<br>
&gt;&gt;&gt;&nbsp;x.itemsize<br>
8<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,2,3],&nbsp;dtype=np.complex128)<br>
&gt;&gt;&gt;&nbsp;x.itemsize<br>
16</tt></dd>
</dl>
<dl><dt><strong>nbytes</strong></dt>
<dd><tt>Total&nbsp;bytes&nbsp;consumed&nbsp;by&nbsp;the&nbsp;elements&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Notes<br>
-----<br>
Does&nbsp;not&nbsp;include&nbsp;memory&nbsp;consumed&nbsp;by&nbsp;non-element&nbsp;attributes&nbsp;of&nbsp;the<br>
array&nbsp;object.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.zeros((3,5,2),&nbsp;dtype=np.complex128)<br>
&gt;&gt;&gt;&nbsp;x.nbytes<br>
480<br>
&gt;&gt;&gt;&nbsp;np.prod(x.shape)&nbsp;*&nbsp;x.itemsize<br>
480</tt></dd>
</dl>
<dl><dt><strong>ndim</strong></dt>
<dd><tt>Number&nbsp;of&nbsp;array&nbsp;dimensions.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,&nbsp;2,&nbsp;3])<br>
&gt;&gt;&gt;&nbsp;x.ndim<br>
1<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;np.zeros((2,&nbsp;3,&nbsp;4))<br>
&gt;&gt;&gt;&nbsp;y.ndim<br>
3</tt></dd>
</dl>
<dl><dt><strong>real</strong></dt>
<dd><tt>The&nbsp;real&nbsp;part&nbsp;of&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.sqrt([1+0j,&nbsp;0+1j])<br>
&gt;&gt;&gt;&nbsp;x.real<br>
array([&nbsp;1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.70710678])<br>
&gt;&gt;&gt;&nbsp;x.real.dtype<br>
dtype('float64')<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.real&nbsp;:&nbsp;equivalent&nbsp;function</tt></dd>
</dl>
<dl><dt><strong>shape</strong></dt>
<dd><tt>Tuple&nbsp;of&nbsp;array&nbsp;dimensions.<br>
&nbsp;<br>
Notes<br>
-----<br>
May&nbsp;be&nbsp;used&nbsp;to&nbsp;"reshape"&nbsp;the&nbsp;array,&nbsp;as&nbsp;long&nbsp;as&nbsp;this&nbsp;would&nbsp;not<br>
require&nbsp;a&nbsp;change&nbsp;in&nbsp;the&nbsp;total&nbsp;number&nbsp;of&nbsp;elements<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.array([1,&nbsp;2,&nbsp;3,&nbsp;4])<br>
&gt;&gt;&gt;&nbsp;x.shape<br>
(4,)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;np.zeros((2,&nbsp;3,&nbsp;4))<br>
&gt;&gt;&gt;&nbsp;y.shape<br>
(2,&nbsp;3,&nbsp;4)<br>
&gt;&gt;&gt;&nbsp;y.shape&nbsp;=&nbsp;(3,&nbsp;8)<br>
&gt;&gt;&gt;&nbsp;y<br>
array([[&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.]])<br>
&gt;&gt;&gt;&nbsp;y.shape&nbsp;=&nbsp;(3,&nbsp;6)<br>
Traceback&nbsp;(most&nbsp;recent&nbsp;call&nbsp;last):<br>
&nbsp;&nbsp;File&nbsp;"&lt;stdin&gt;",&nbsp;line&nbsp;1,&nbsp;in&nbsp;&lt;module&gt;<br>
ValueError:&nbsp;total&nbsp;size&nbsp;of&nbsp;new&nbsp;array&nbsp;must&nbsp;be&nbsp;unchanged</tt></dd>
</dl>
<dl><dt><strong>size</strong></dt>
<dd><tt>Number&nbsp;of&nbsp;elements&nbsp;in&nbsp;the&nbsp;array.<br>
&nbsp;<br>
Equivalent&nbsp;to&nbsp;``np.prod(a.shape)``,&nbsp;i.e.,&nbsp;the&nbsp;product&nbsp;of&nbsp;the&nbsp;array's<br>
dimensions.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.zeros((3,&nbsp;5,&nbsp;2),&nbsp;dtype=np.complex128)<br>
&gt;&gt;&gt;&nbsp;x.size<br>
30<br>
&gt;&gt;&gt;&nbsp;np.prod(x.shape)<br>
30</tt></dd>
</dl>
<dl><dt><strong>strides</strong></dt>
<dd><tt>Tuple&nbsp;of&nbsp;bytes&nbsp;to&nbsp;step&nbsp;in&nbsp;each&nbsp;dimension&nbsp;when&nbsp;traversing&nbsp;an&nbsp;array.<br>
&nbsp;<br>
The&nbsp;byte&nbsp;offset&nbsp;of&nbsp;element&nbsp;``(i[0],&nbsp;i[1],&nbsp;...,&nbsp;i[n])``&nbsp;in&nbsp;an&nbsp;array&nbsp;`a`<br>
is::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;offset&nbsp;=&nbsp;sum(np.array(i)&nbsp;*&nbsp;a.strides)<br>
&nbsp;<br>
A&nbsp;more&nbsp;detailed&nbsp;explanation&nbsp;of&nbsp;strides&nbsp;can&nbsp;be&nbsp;found&nbsp;in&nbsp;the<br>
"ndarray.rst"&nbsp;file&nbsp;in&nbsp;the&nbsp;NumPy&nbsp;reference&nbsp;guide.<br>
&nbsp;<br>
Notes<br>
-----<br>
Imagine&nbsp;an&nbsp;array&nbsp;of&nbsp;32-bit&nbsp;integers&nbsp;(each&nbsp;4&nbsp;bytes)::<br>
&nbsp;<br>
&nbsp;&nbsp;x&nbsp;=&nbsp;np.array([[0,&nbsp;1,&nbsp;2,&nbsp;3,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[5,&nbsp;6,&nbsp;7,&nbsp;8,&nbsp;9]],&nbsp;dtype=np.int32)<br>
&nbsp;<br>
This&nbsp;array&nbsp;is&nbsp;stored&nbsp;in&nbsp;memory&nbsp;as&nbsp;40&nbsp;bytes,&nbsp;one&nbsp;after&nbsp;the&nbsp;other<br>
(known&nbsp;as&nbsp;a&nbsp;contiguous&nbsp;block&nbsp;of&nbsp;memory).&nbsp;&nbsp;The&nbsp;strides&nbsp;of&nbsp;an&nbsp;array&nbsp;tell<br>
us&nbsp;how&nbsp;many&nbsp;bytes&nbsp;we&nbsp;have&nbsp;to&nbsp;skip&nbsp;in&nbsp;memory&nbsp;to&nbsp;move&nbsp;to&nbsp;the&nbsp;next&nbsp;position<br>
along&nbsp;a&nbsp;certain&nbsp;axis.&nbsp;&nbsp;For&nbsp;example,&nbsp;we&nbsp;have&nbsp;to&nbsp;skip&nbsp;4&nbsp;bytes&nbsp;(1&nbsp;value)&nbsp;to<br>
move&nbsp;to&nbsp;the&nbsp;next&nbsp;column,&nbsp;but&nbsp;20&nbsp;bytes&nbsp;(5&nbsp;values)&nbsp;to&nbsp;get&nbsp;to&nbsp;the&nbsp;same<br>
position&nbsp;in&nbsp;the&nbsp;next&nbsp;row.&nbsp;&nbsp;As&nbsp;such,&nbsp;the&nbsp;strides&nbsp;for&nbsp;the&nbsp;array&nbsp;`x`&nbsp;will&nbsp;be<br>
``(20,&nbsp;4)``.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
numpy.lib.stride_tricks.as_strided<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;np.reshape(np.arange(2*3*4),&nbsp;(2,3,4))<br>
&gt;&gt;&gt;&nbsp;y<br>
array([[[&nbsp;0,&nbsp;&nbsp;1,&nbsp;&nbsp;2,&nbsp;&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4,&nbsp;&nbsp;5,&nbsp;&nbsp;6,&nbsp;&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;8,&nbsp;&nbsp;9,&nbsp;10,&nbsp;11]],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[12,&nbsp;13,&nbsp;14,&nbsp;15],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[16,&nbsp;17,&nbsp;18,&nbsp;19],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[20,&nbsp;21,&nbsp;22,&nbsp;23]]])<br>
&gt;&gt;&gt;&nbsp;y.strides<br>
(48,&nbsp;16,&nbsp;4)<br>
&gt;&gt;&gt;&nbsp;y[1,1,1]<br>
17<br>
&gt;&gt;&gt;&nbsp;offset=sum(y.strides&nbsp;*&nbsp;np.array((1,1,1)))<br>
&gt;&gt;&gt;&nbsp;offset/y.itemsize<br>
17<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.reshape(np.arange(5*6*7*8),&nbsp;(5,6,7,8)).transpose(2,3,1,0)<br>
&gt;&gt;&gt;&nbsp;x.strides<br>
(32,&nbsp;4,&nbsp;224,&nbsp;1344)<br>
&gt;&gt;&gt;&nbsp;i&nbsp;=&nbsp;np.array([3,5,2,2])<br>
&gt;&gt;&gt;&nbsp;offset&nbsp;=&nbsp;sum(i&nbsp;*&nbsp;x.strides)<br>
&gt;&gt;&gt;&nbsp;x[3,5,2,2]<br>
813<br>
&gt;&gt;&gt;&nbsp;offset&nbsp;/&nbsp;x.itemsize<br>
813</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="numpy.html#ndarray">numpy.ndarray</a>:<br>
<dl><dt><strong>__hash__</strong> = None</dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-create_optimizer"><strong>create_optimizer</strong></a>(fitness, update_velocity<font color="#909090">=&lt;function create_update_velocity.&lt;locals&gt;.update_velocity&gt;</font>, update_position<font color="#909090">=&lt;function create_update_position.&lt;locals&gt;.update_position&gt;</font>, bounds<font color="#909090">=None</font>)</dt><dd><tt>Create&nbsp;a&nbsp;particle&nbsp;swarm&nbsp;optimizer&nbsp;function.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;fitness:&nbsp;A&nbsp;function&nbsp;that&nbsp;accepts&nbsp;a&nbsp;particle&nbsp;as&nbsp;input&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returns&nbsp;its&nbsp;fitness&nbsp;as&nbsp;a&nbsp;real&nbsp;value&nbsp;between&nbsp;0&nbsp;and&nbsp;1.<br>
&nbsp;<br>
Keywords:<br>
&nbsp;&nbsp;&nbsp;&nbsp;update_velocity:&nbsp;A&nbsp;function&nbsp;that&nbsp;accepts&nbsp;as&nbsp;inputs&nbsp;a&nbsp;particle&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;global&nbsp;best&nbsp;particle&nbsp;and&nbsp;returns&nbsp;a&nbsp;new<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;velocity&nbsp;for&nbsp;the&nbsp;given&nbsp;particle.<br>
&nbsp;&nbsp;&nbsp;&nbsp;update_position:&nbsp;A&nbsp;function&nbsp;that&nbsp;accepts&nbsp;a&nbsp;particle&nbsp;as&nbsp;its&nbsp;only<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input&nbsp;and&nbsp;returns&nbsp;a&nbsp;new&nbsp;particle&nbsp;position.<br>
&nbsp;&nbsp;&nbsp;&nbsp;bounds:&nbsp;A&nbsp;tuple&nbsp;of&nbsp;(low,&nbsp;high)&nbsp;real&nbsp;values&nbsp;that&nbsp;set&nbsp;the&nbsp;bounds<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;a&nbsp;particle's&nbsp;velocity.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;particle&nbsp;swarm&nbsp;optimization&nbsp;function.</tt></dd></dl>
 <dl><dt><a name="-create_update_position"><strong>create_update_position</strong></a>()</dt><dd><tt>Create&nbsp;an&nbsp;update&nbsp;particle&nbsp;position&nbsp;function&nbsp;for&nbsp;use&nbsp;with&nbsp;create_optimizer.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;An&nbsp;update&nbsp;position&nbsp;function&nbsp;-&nbsp;see&nbsp;documentation&nbsp;for&nbsp;update_position.</tt></dd></dl>
 <dl><dt><a name="-create_update_velocity"><strong>create_update_velocity</strong></a>(learning_factor1<font color="#909090">=2</font>, learning_factor2<font color="#909090">=2</font>)</dt><dd><tt>Create&nbsp;an&nbsp;update&nbsp;velocity&nbsp;function&nbsp;for&nbsp;use&nbsp;with&nbsp;create_optimizer.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;learning_factor1:&nbsp;Value&nbsp;for&nbsp;the&nbsp;first&nbsp;learning&nbsp;factor&nbsp;(c1).<br>
&nbsp;&nbsp;&nbsp;&nbsp;learning_factor2:&nbsp;Value&nbsp;for&nbsp;the&nbsp;second&nbsp;learning&nbsp;factor&nbsp;(c2).<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;update&nbsp;velocity&nbsp;function.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>DEFAULT_LEARNING_FACTOR1</strong> = 2<br>
<strong>DEFAULT_LEARNING_FACTOR2</strong> = 2<br>
<strong>__contact__</strong> = 'jerradgenson@gmail.com'<br>
<strong>__copyright__</strong> = 'Copyright 2013 Jerrad Michael Genson'<br>
<strong>__license__</strong> = 'BSD 3-Clause'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Jerrad&nbsp;Genson</td></tr></table>
</body></html>